diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-02-18 06:57:16 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-02-18 06:57:16 +0000 |
commit | 9568a305878d0c035e027c1ed6c9a24147a0adea (patch) | |
tree | ca6f2d1d61114f11057938c654ec004042412f1f /src/net | |
parent | a0edd2e04b263faa13f6fbfbb81dd7c64520e584 (diff) | |
download | mana-client-9568a305878d0c035e027c1ed6c9a24147a0adea.tar.gz mana-client-9568a305878d0c035e027c1ed6c9a24147a0adea.tar.bz2 mana-client-9568a305878d0c035e027c1ed6c9a24147a0adea.tar.xz mana-client-9568a305878d0c035e027c1ed6c9a24147a0adea.zip |
Centralize current_npc cleanup
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 2 | ||||
-rw-r--r-- | src/net/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index f757308c..3e746eb5 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -214,7 +214,7 @@ void BeingHandler::handleMessage(MessageIn *msg) player_node->stopAttack(); if (dstBeing == current_npc) - current_npc = NULL; + current_npc->handleDeath(); if (msg->readInt8() == 1) dstBeing->setAction(Being::DEAD); diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index 67c79ec4..a2442d70 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -107,7 +107,7 @@ void BuySellHandler::handleMessage(MessageIn *msg) } else { chatWindow->chatLog(_("Nothing to sell"), BY_SERVER); - current_npc = 0; + if (current_npc) current_npc->handleDeath(); } break; diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index e142dd91..74e959da 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -86,7 +86,7 @@ namespace { buyDialog->setVisible(false); sellDialog->setVisible(false); buySellDialog->setVisible(false); - current_npc = 0; + if (current_npc) current_npc->handleDeath(); } } deathListener; } @@ -140,7 +140,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) // Switch the actual map, deleting the previous one if necessary engine->changeMap(mapPath); - current_npc = 0; + if (current_npc) current_npc->handleDeath(); float scrollOffsetX = 0.0f; float scrollOffsetY = 0.0f; |