diff options
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, |