diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 5 |
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); |