diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-02-25 13:38:55 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-02-25 13:38:55 -0700 |
commit | f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1 (patch) | |
tree | 1822aa7cecfbe4ef38b55216ab82b686e3b636c7 /src/net/beinghandler.cpp | |
parent | 9673149ea3c28f42f38fc9989faf76d68e72bd20 (diff) | |
download | mana-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.gz mana-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.bz2 mana-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.xz mana-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.zip |
Fix NPC handling to not need a handle on the NPC
The Being ID is used instead, as that is all that was ever really
needed.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 3e746eb5..982667d1 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -35,6 +35,10 @@ #include "../npc.h" #include "../player_relations.h" +#include "../gui/npc_text.h" + +extern NpcTextDialog *npcTextDialog; + const int EMOTION_TIME = 150; /**< Duration of emotion icon */ BeingHandler::BeingHandler(bool enableSync): @@ -204,7 +208,12 @@ void BeingHandler::handleMessage(MessageIn *msg) case SMSG_BEING_REMOVE: // A being should be removed or has died - dstBeing = beingManager->findBeing(msg->readInt32()); + id = msg->readInt32(); + + if (id == current_npc) + npcTextDialog->showCloseButton(); + + dstBeing = beingManager->findBeing(id); if (!dstBeing) break; @@ -213,9 +222,6 @@ void BeingHandler::handleMessage(MessageIn *msg) if (dstBeing == player_node->getTarget()) player_node->stopAttack(); - if (dstBeing == current_npc) - current_npc->handleDeath(); - if (msg->readInt8() == 1) dstBeing->setAction(Being::DEAD); else |