summaryrefslogtreecommitdiff
path: root/src/net/playerhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/playerhandler.cpp')
-rw-r--r--src/net/playerhandler.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index 7f9e455a..e871b670 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -129,6 +129,12 @@ void PlayerHandler::handleMessage(MessageIn *msg)
logger->log("Warping to %s (%d, %d)", mapPath.c_str(), x, y);
+ /*
+ * We must clear the local player's target *before* the call
+ * to changeMap, as it deletes all beings.
+ */
+ player_node->stopAttack();
+
// Switch the actual map, deleting the previous one
engine->changeMap(mapPath);
@@ -138,7 +144,6 @@ void PlayerHandler::handleMessage(MessageIn *msg)
float scrollOffsetY = (y - player_node->mY) * 32;
player_node->setAction(Being::STAND);
- player_node->stopAttack();
player_node->mFrame = 0;
player_node->mX = x;
player_node->mY = y;