From 5980dba7ace73e6587b9966bc2076ad2b2eaa5f0 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Sun, 27 Aug 2006 08:58:42 +0000 Subject: Send movements. --- src/net/beinghandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/net/beinghandler.cpp') 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); + } } } -- cgit v1.2.3-70-g09d2