summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-05-28 12:21:19 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2011-05-28 12:21:19 +0200
commit1b3bceb471a0c28908a2d84f3cf658036cbea761 (patch)
treecb298a7eb5c37f867b550621f1eca7af80b8b348 /src/net
parent1b7652146d9e529193e9a1c23512fcc405031e90 (diff)
downloadmana-client-1b3bceb471a0c28908a2d84f3cf658036cbea761.tar.gz
mana-client-1b3bceb471a0c28908a2d84f3cf658036cbea761.tar.bz2
mana-client-1b3bceb471a0c28908a2d84f3cf658036cbea761.tar.xz
mana-client-1b3bceb471a0c28908a2d84f3cf658036cbea761.zip
Fixing setting of being position
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/beinghandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 960f08ed..b7cf7bd9 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -110,12 +110,13 @@ static void handleMoveMessage(Map *map, Being *dstBeing,
{
Vector pos = map->getTileCenter(srcX, srcY);
Vector dest = map->getTileCenter(dstX, dstY);
+ Vector beingPos = dstBeing->getPosition();
// Don't set the position as the movement algorithm
// can guess it and it would break the animation played,
// when we're close enough.
- if (std::abs(dest.x - pos.x) > POS_DEST_DIFF_TOLERANCE
- || std::abs(dest.y - pos.y) > POS_DEST_DIFF_TOLERANCE)
+ if (std::abs(beingPos.x - pos.x) > POS_DEST_DIFF_TOLERANCE
+ || std::abs(beingPos.y - pos.y) > POS_DEST_DIFF_TOLERANCE)
dstBeing->setPosition(pos);
dstBeing->setDestination(dest.x, dest.y);