diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-09 22:59:22 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-09 22:59:22 +0000 |
commit | 81c7e13077dde99ea360f2ab8432aa48444f3b88 (patch) | |
tree | eb9afd47e2e5dd2b8c6a3de1278fa77765d8b85b /src/net | |
parent | d342307c408c687405bae557c1fff7ac0e9891b9 (diff) | |
download | mana-81c7e13077dde99ea360f2ab8432aa48444f3b88.tar.gz mana-81c7e13077dde99ea360f2ab8432aa48444f3b88.tar.bz2 mana-81c7e13077dde99ea360f2ab8432aa48444f3b88.tar.xz mana-81c7e13077dde99ea360f2ab8432aa48444f3b88.zip |
Fitted being trajectories to synchronization messages.
Diffstat (limited to 'src/net')
-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); + } } } |