summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 93f5f1a8..4ff92b63 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -421,8 +421,17 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
if (!being) continue;
int sx = msg.readShort(), sy = msg.readShort(),
dx = msg.readShort(), dy = msg.readShort();
- being->mX = sx / 32;
- being->mY = sy / 32;
- being->setDestination(dx / 32, dy / 32);
+ bool update = being != player_node; // the local player already knows where he wants to go
+ if (abs(being->mX - sx / 32) + abs(being->mY - sy / 32) > 4)
+ {
+ // crude handling of synchronization messages
+ being->mX = sx / 32;
+ being->mY = sy / 32;
+ update = true;
+ }
+ if (update)
+ {
+ being->setDestination(dx / 32, dy / 32);
+ }
}
}