From 6265ef44e8308ac9a27abec68839c2a884a8f09e Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Tue, 15 Mar 2011 18:22:41 +0100 Subject: Reset destination to position at warp time for TmwAthena. This fix the following bug: When changing map, the local player sometimes walks randomly until the player reacts. --- src/net/tmwa/playerhandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa/playerhandler.cpp') diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index b05c11d7..9210de6e 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -215,8 +215,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) } player_node->setAction(Being::STAND); - player_node->setPosition(Vector(x * tileWidth + tileWidth / 2, - y * tileHeight + tileHeight / 2)); + Vector pos(x * tileWidth + tileWidth / 2, + y * tileHeight + tileHeight / 2); + player_node->setPosition(pos); + // Stop movement + player_node->setDestination(pos.x, pos.y); logger->log("Adjust scrolling by %d:%d", (int) scrollOffsetX, (int) scrollOffsetY); -- cgit v1.2.3-70-g09d2