diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-22 21:44:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-22 21:44:22 +0300 |
commit | ab3b909187ee0a18946bff50a6bd3e8e281970f1 (patch) | |
tree | 070f99fa55315de2a4e688e5ff0397e395681d28 /src/net/tmwa | |
parent | d27c8b53bcd8c7e8e0aa74656e32aeb688629b4b (diff) | |
download | manaverse-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.gz manaverse-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.bz2 manaverse-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.xz manaverse-ab3b909187ee0a18946bff50a6bd3e8e281970f1.zip |
Remove checking packet id in getNpc function.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 16 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.h | 3 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 351cb2d7a..f742ecb38 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -31,7 +31,6 @@ #include "net/messagein.h" #include "net/tmwa/messageout.h" -#include "net/tmwa/protocolin.h" #include "net/tmwa/protocolout.h" #include "net/ea/eaprotocol.h" @@ -180,16 +179,9 @@ void NpcHandler::selectAutoSpell(const int skillId A_UNUSED) const { } -BeingId NpcHandler::getNpc(Net::MessageIn &msg) +BeingId NpcHandler::getNpc(Net::MessageIn &msg, + const NpcAction action) { - // +++ must be removed packet id checks from here - if (msg.getId() == SMSG_NPC_CHOICE - || msg.getId() == SMSG_NPC_MESSAGE - || msg.getId() == SMSG_NPC_CHANGETITLE) - { - msg.readInt16("len"); - } - const BeingId npcId = msg.readBeingId("npc id"); const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); @@ -199,12 +191,12 @@ BeingId NpcHandler::getNpc(Net::MessageIn &msg) { // +++ must be removed packet id checks from here // Empty dialogs don't help - if (msg.getId() == SMSG_NPC_CLOSE) + if (action == NpcAction::Close) { closeDialog(npcId); return npcId; } - else if (msg.getId() == SMSG_NPC_NEXT) + else if (action == NpcAction::Next) { nextDialog(npcId); return npcId; diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index a69845724..51402768c 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -65,7 +65,8 @@ class NpcHandler final : public Ea::NpcHandler void completeProgressBar() const override final; - BeingId getNpc(Net::MessageIn &msg) override final; + BeingId getNpc(Net::MessageIn &msg, + const NpcAction action) override final; void produceMix(const int nameId, const int materialId1, |