summaryrefslogtreecommitdiff
path: root/src/net/tmwa/playerhandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-15 18:22:41 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-15 18:22:41 +0100
commit6265ef44e8308ac9a27abec68839c2a884a8f09e (patch)
tree332acf88dde77a957283d01cb892c358ccc6a1e2 /src/net/tmwa/playerhandler.cpp
parent911444a5b910691816acfccf65151296042fb724 (diff)
downloadmana-6265ef44e8308ac9a27abec68839c2a884a8f09e.tar.gz
mana-6265ef44e8308ac9a27abec68839c2a884a8f09e.tar.bz2
mana-6265ef44e8308ac9a27abec68839c2a884a8f09e.tar.xz
mana-6265ef44e8308ac9a27abec68839c2a884a8f09e.zip
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.
Diffstat (limited to 'src/net/tmwa/playerhandler.cpp')
-rw-r--r--src/net/tmwa/playerhandler.cpp7
1 files changed, 5 insertions, 2 deletions
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);