From ba07ca55476c488504a8d8bf9318f15aab687f12 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Sep 2014 14:44:03 +0300 Subject: Fix mercenary removing. --- src/net/eathena/mercenaryhandler.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/net/eathena/mercenaryhandler.cpp') 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 -- cgit v1.2.3-60-g2f50