diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:30 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:30 +0000 |
commit | fe474eb4fae9d89e3797d0ceaae6613798ce491f (patch) | |
tree | 2a91b2f17636ae7b20eea06a28a89942f6f36d39 /src/net/beinghandler.cpp | |
parent | 3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf (diff) | |
download | mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.gz mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.bz2 mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.xz mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.zip |
Synchronized pathfinding algorithmns with those used by the server to avoid asynchronisation.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 05795cb1..f31ee48b 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -496,8 +496,7 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg) return; } - being->mX = px; - being->mY = py; + being->setPositionInPixels(px, py); being->setDestination(px, py); being->setAction(action); } @@ -544,11 +543,10 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) { being->setWalkSpeed(speed * 10); } - if (abs(being->mX - sx) + abs(being->mY - sy) > 4 * 32) + if (abs(being->getPixelX() - sx) + abs(being->getPixelY() - sy) > 4 * 32) { // Too large a desynchronization. - being->mX = sx; - being->mY = sy; + being->setPositionInPixels(sx, sy); being->setDestination(dx, dy); } else if (!(flags & MOVING_POSITION)) @@ -582,8 +580,6 @@ void BeingHandler::handleBeingAttackMessage(MessageIn &msg) case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; } - logger->log("Attacktype: %d", attackType); - being->setAction(Being::ATTACK, attackType); } |