diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-04-26 21:56:31 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-04 08:19:09 -0600 |
commit | 375ceb6c78f79e0144c2d63e0f9cda170288da8b (patch) | |
tree | 525f30b77566fdcdeb819a79269c375cccfc2cb9 | |
parent | 22a7ac0b9ed82d09460d791016a990b327b61fc4 (diff) | |
download | mana-375ceb6c78f79e0144c2d63e0f9cda170288da8b.tar.gz mana-375ceb6c78f79e0144c2d63e0f9cda170288da8b.tar.bz2 mana-375ceb6c78f79e0144c2d63e0f9cda170288da8b.tar.xz mana-375ceb6c78f79e0144c2d63e0f9cda170288da8b.zip |
Clear NPC dialogs when the player dies
Reviewed-by: Freeyorp
-rw-r--r-- | src/net/manaserv/npchandler.cpp | 5 | ||||
-rw-r--r-- | src/net/manaserv/npchandler.h | 2 | ||||
-rw-r--r-- | src/net/manaserv/playerhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 5 |
6 files changed, 24 insertions, 0 deletions
diff --git a/src/net/manaserv/npchandler.cpp b/src/net/manaserv/npchandler.cpp index 258c72c0..392ec4fd 100644 --- a/src/net/manaserv/npchandler.cpp +++ b/src/net/manaserv/npchandler.cpp @@ -225,4 +225,9 @@ void NpcHandler::endShopping(int beingId) // TODO } +void NpcHandler::clearDialogs() +{ + mNpcDialogs.clear(); +} + } // namespace ManaServ diff --git a/src/net/manaserv/npchandler.h b/src/net/manaserv/npchandler.h index 7f48c738..689fdc1d 100644 --- a/src/net/manaserv/npchandler.h +++ b/src/net/manaserv/npchandler.h @@ -66,6 +66,8 @@ class NpcHandler : public MessageHandler, public Net::NpcHandler void endShopping(int beingId); + void clearDialogs(); + private: typedef struct { NpcDialog* dialog; diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index 3a5d68a2..f6207800 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -40,6 +40,7 @@ #include "net/manaserv/connection.h" #include "net/manaserv/messagein.h" #include "net/manaserv/messageout.h" +#include "net/manaserv/npchandler.h" #include "net/manaserv/protocol.h" /** @@ -57,6 +58,10 @@ namespace ManaServ { void RespawnRequestListener::action(const gcn::ActionEvent &event) { Net::getPlayerHandler()->respawn(); + + ManaServ::NpcHandler *handler = + static_cast<ManaServ::NpcHandler*>(Net::getNpcHandler()); + handler->clearDialogs(); } extern Connection *gameServerConnection; diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index e6b16f2d..5888c679 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -223,4 +223,9 @@ void NpcHandler::endShopping(int beingId) // TODO } +void NpcHandler::clearDialogs() +{ + mNpcDialogs.clear(); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index a40371a6..bd696bdd 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -67,6 +67,8 @@ class NpcHandler : public MessageHandler, public Net::NpcHandler void endShopping(int beingId); + void clearDialogs(); + private: typedef struct { NpcDialog* dialog; diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index afa2c71b..5aab94b8 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -42,6 +42,7 @@ #include "net/messageout.h" #include "net/tmwa/protocol.h" +#include "net/tmwa/npchandler.h" #include "utils/stringutils.h" #include "utils/gettext.h" @@ -86,6 +87,10 @@ namespace { SellDialog::closeAll(); viewport->closePopupMenu(); + + TmwAthena::NpcHandler *handler = + static_cast<TmwAthena::NpcHandler*>(Net::getNpcHandler()); + handler->clearDialogs(); } } deathListener; |