From b506fe0ff8a2039167aa7c349087af4dd03e1921 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 28 Aug 2008 18:01:15 +0000 Subject: Applied patch put together by Jaxad0127 with changes from the Aethyra project. Improves compatibility with the newer version of eAthena and works around an initialization bug. --- src/net/playerhandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/net/playerhandler.cpp') diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 2502c144..463868db 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -123,6 +123,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); @@ -132,7 +138,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; -- cgit v1.2.3-70-g09d2