From: Perttu Ahola Date: Mon, 17 Jan 2011 22:27:14 +0000 (+0200) Subject: fixed erroneus handling of many players with no peer existing at same time X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=b6787a2b588f516184bf53ef8ae6af79ca54af25;p=zefram%2Fminetest%2Fminetest_engine.git fixed erroneus handling of many players with no peer existing at same time --- 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;