aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-10 23:05:21 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-10 23:05:21 +0300
commit26eb607a111a4a396283ffd55b90bd9c5fbaaf90 (patch)
tree5cb389a781096713f98a7b14ec400f67c335fc7d
parentb0b5c432542ea5f9292f428bb59e2670c0d7c53d (diff)
downloadminetest-26eb607a111a4a396283ffd55b90bd9c5fbaaf90.tar.gz
minetest-26eb607a111a4a396283ffd55b90bd9c5fbaaf90.tar.bz2
minetest-26eb607a111a4a396283ffd55b90bd9c5fbaaf90.zip
Made environment to not consider disconnected players when dealing with ActiveObjects
-rw-r--r--src/environment.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 77746c5be..efcdbbd15 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)