aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-09-01 18:32:15 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-09-01 18:32:15 +0300
commitb6c12d2aa3f7f3f0faca86a0b20904e309c15179 (patch)
tree0fc1097b066c8057ad858ee3a71e6a180ecfd18c /src
parent7a14171be4cdb2d78b9cb361b4fc10137ba3299c (diff)
downloadminetest-b6c12d2aa3f7f3f0faca86a0b20904e309c15179.tar.gz
minetest-b6c12d2aa3f7f3f0faca86a0b20904e309c15179.tar.bz2
minetest-b6c12d2aa3f7f3f0faca86a0b20904e309c15179.zip
Fix github issue #224
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server.cpp b/src/server.cpp
index ba99f4707..2da9cbe24 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -442,9 +442,12 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
m_nearest_unsent_reset_timer += dtime;
if(m_nothing_to_send_pause_timer >= 0)
- {
return;
- }
+
+ Player *player = server->m_env->getPlayer(peer_id);
+ // This can happen sometimes; clients and players are not in perfect sync.
+ if(player == NULL)
+ return;
// Won't send anything if already sending
if(m_blocks_sending.size() >= g_settings->getU16
@@ -456,10 +459,6 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
//TimeTaker timer("RemoteClient::GetNextBlocks");
- Player *player = server->m_env->getPlayer(peer_id);
-
- assert(player != NULL);
-
v3f playerpos = player->getPosition();
v3f playerspeed = player->getSpeed();
v3f playerspeeddir(0,0,0);