diff options
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index eb5ccb57..2d68dd28 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -469,17 +469,24 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) { continue; } - bool update = being != player_node; // the local player already knows where he wants to go if (abs(being->mX - sx) + abs(being->mY - sy) > 4 * 32) { - // crude handling of synchronization messages + // Too large a desynchronization. being->mX = sx; being->mY = sy; - update = true; + being->setDestination(dx, dy); } - if (update && (flags & MOVING_DESTINATION)) + else if (!(flags & MOVING_POSITION)) { being->setDestination(dx, dy); } + else if (!(flags & MOVING_DESTINATION)) + { + being->adjustCourse(sx, sy); + } + else + { + being->adjustCourse(sx, sy, dx, dy); + } } } |