From 1b3bceb471a0c28908a2d84f3cf658036cbea761 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 28 May 2011 12:21:19 +0200 Subject: Fixing setting of being position --- src/net/tmwa/beinghandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2