diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-01-18 00:27:14 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-01-18 00:27:14 +0200 |
commit | b6787a2b588f516184bf53ef8ae6af79ca54af25 (patch) | |
tree | 4173646b2a082c30a5c8392b7b66e3b58048e63c /src | |
parent | 198632673196c87c5ba549721300d2e2b452f28b (diff) | |
download | minetest-b6787a2b588f516184bf53ef8ae6af79ca54af25.tar.gz minetest-b6787a2b588f516184bf53ef8ae6af79ca54af25.tar.bz2 minetest-b6787a2b588f516184bf53ef8ae6af79ca54af25.zip |
fixed erroneus handling of many players with no peer existing at same time
Diffstat (limited to 'src')
-rw-r--r-- | src/environment.cpp | 3 | ||||
-rw-r--r-- | src/environment.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 17b98acd1..6d987e3c2 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 03f366b47..fa7253170 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<Player*> m_players; // Debug output goes here std::ostream &m_dout; |