diff options
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 6d987e3c2..51ed05422 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -190,9 +190,16 @@ Map & Environment::getMap() void Environment::addPlayer(Player *player) { DSTACK(__FUNCTION_NAME); - //Check that only one local player exists and peer_ids are unique + /* + Check that only one local player exists and peer_ids are unique. + Exception: there can be multiple players with peer_id=0 + */ #ifndef SERVER - assert(player->isLocal() == false || getLocalPlayer() == NULL); + /* + It is a failure if player is local and there already is a local + player + */ + assert(!(player->isLocal() == true && getLocalPlayer() != NULL)); #endif if(player->peer_id != 0) assert(getPlayer(player->peer_id) == NULL); |