From: Perttu Ahola Date: Sun, 10 Apr 2011 20:05:21 +0000 (+0300) Subject: Made environment to not consider disconnected players when dealing with ActiveObjects X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=26eb607a111a4a396283ffd55b90bd9c5fbaaf90;p=zefram%2Fminetest%2Fminetest_engine.git Made environment to not consider disconnected players when dealing with ActiveObjects --- diff --git a/src/environment.cpp b/src/environment.cpp index 77746c5b..efcdbbd1 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -397,6 +397,11 @@ void ServerEnvironment::step(float dtime) i != m_players.end(); i++) { Player *player = *i; + + // Ignore disconnected players + if(player->peer_id == 0) + continue; + v3f playerpos = player->getPosition(); // Move @@ -504,6 +509,11 @@ void ServerEnvironment::step(float dtime) i != m_players.end(); i++) { Player *player = *i; + + // Ignore disconnected players + if(player->peer_id == 0) + continue; + v3f playerpos = player->getPosition(); v3s16 blockpos0 = getNodeBlockPos(floatToInt(playerpos, BS)); @@ -589,6 +599,11 @@ void ServerEnvironment::step(float dtime) i != m_players.end(); i++) { Player *player = *i; + + // Ignore disconnected players + if(player->peer_id == 0) + continue; + v3f playerpos = player->getPosition(); f32 d = playerpos.getDistanceFrom(objectpos); if(d < to_static_max_f)