diff options
author | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-17 06:28:13 +0000 |
---|---|---|
committer | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-17 06:28:13 +0000 |
commit | d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18 (patch) | |
tree | d1eb473d5d703ac37c7ed4cdcfc52e4caca5aa95 /src/net/playerhandler.cpp | |
parent | 68888853bc946a52ca368c5fc859b6709ae0e661 (diff) | |
download | mana-client-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.gz mana-client-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.bz2 mana-client-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.xz mana-client-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.zip |
Fixed crash resulting from having a player targeted when hitting a warp point
Diffstat (limited to 'src/net/playerhandler.cpp')
-rw-r--r-- | src/net/playerhandler.cpp | 7 |
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; |