diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-21 14:44:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-21 14:44:03 +0300 |
commit | ba07ca55476c488504a8d8bf9318f15aab687f12 (patch) | |
tree | 3907bcceabda445a9fa8498ff92af09df2c11e08 /src/net/eathena/mercenaryhandler.cpp | |
parent | 46d1266f00dfde5d04d7980daea4bab02e77cb69 (diff) | |
download | plus-ba07ca55476c488504a8d8bf9318f15aab687f12.tar.gz plus-ba07ca55476c488504a8d8bf9318f15aab687f12.tar.bz2 plus-ba07ca55476c488504a8d8bf9318f15aab687f12.tar.xz plus-ba07ca55476c488504a8d8bf9318f15aab687f12.zip |
Fix mercenary removing.
Diffstat (limited to 'src/net/eathena/mercenaryhandler.cpp')
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index a614cf429..0726f5281 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -22,6 +22,7 @@ #include "actormanager.h" #include "logger.h" +#include "notifymanager.h" #include "being/being.h" #include "being/localplayer.h" @@ -35,6 +36,8 @@ #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" +#include "resources/notifytypes.h" + #include "debug.h" extern Net::MercenaryHandler *mercenaryHandler; @@ -152,4 +155,33 @@ void MercenaryHandler::processMercenarySkills(Net::MessageIn &msg) skillDialog->update(); } +void MercenaryHandler::handleMercenaryMessage(const int cmd) +{ + PlayerInfo::setMercenary(nullptr); + if (skillDialog) + { + skillDialog->hideSkills(SkillOwner::Mercenary); + skillDialog->update(); + } + + switch (cmd) + { + case 0: + NotifyManager::notify(NotifyTypes::MERCENARY_EXPIRED); + break; + case 1: + NotifyManager::notify(NotifyTypes::MERCENARY_KILLED); + break; + case 2: + NotifyManager::notify(NotifyTypes::MERCENARY_FIRED); + break; + case 3: + NotifyManager::notify(NotifyTypes::MERCENARY_RUN); + break; + default: + NotifyManager::notify(NotifyTypes::MERCENARY_UNKNOWN); + break; + } +} + } // namespace EAthena |