From b6787a2b588f516184bf53ef8ae6af79ca54af25 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 18 Jan 2011 00:27:14 +0200 Subject: [PATCH] fixed erroneus handling of many players with no peer existing at same time --- src/environment.cpp | 3 ++- src/environment.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/environment.cpp b/src/environment.cpp index 17b98acd..6d987e3c 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -194,7 +194,8 @@ void Environment::addPlayer(Player *player) #ifndef SERVER assert(player->isLocal() == false || getLocalPlayer() == NULL); #endif - assert(getPlayer(player->peer_id) == NULL); + if(player->peer_id != 0) + assert(getPlayer(player->peer_id) == NULL); m_players.push_back(player); } diff --git a/src/environment.h b/src/environment.h index 03f366b4..fa725317 100644 --- a/src/environment.h +++ b/src/environment.h @@ -73,6 +73,8 @@ public: private: Map *m_map; + // peer_ids in here should be unique, except that there may be + // many 0s core::list m_players; // Debug output goes here std::ostream &m_dout; -- 2.30.2