summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-22 21:44:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-22 21:44:22 +0300
commitab3b909187ee0a18946bff50a6bd3e8e281970f1 (patch)
tree070f99fa55315de2a4e688e5ff0397e395681d28 /src/net/eathena
parentd27c8b53bcd8c7e8e0aa74656e32aeb688629b4b (diff)
downloadplus-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.gz
plus-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.bz2
plus-ab3b909187ee0a18946bff50a6bd3e8e281970f1.tar.xz
plus-ab3b909187ee0a18946bff50a6bd3e8e281970f1.zip
Remove checking packet id in getNpc function.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/npchandler.cpp21
-rw-r--r--src/net/eathena/npchandler.h3
2 files changed, 6 insertions, 18 deletions
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 74474b08f..97b1c28dc 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -34,7 +34,6 @@
#include "net/ea/npcrecv.h"
#include "net/eathena/messageout.h"
-#include "net/eathena/protocolin.h"
#include "net/eathena/protocolout.h"
#include "debug.h"
@@ -196,35 +195,23 @@ void NpcHandler::selectAutoSpell(const int skillId) const
outMsg.writeInt32(static_cast<int16_t>(skillId), "skill id");
}
-BeingId NpcHandler::getNpc(Net::MessageIn &msg)
+BeingId NpcHandler::getNpc(Net::MessageIn &msg,
+ const NpcAction action)
{
- // +++ must be removed SMSG_*
- 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);
Ea::NpcRecv::mDialog = nullptr;
- // +++ must be removed SMSG_*
- if (msg.getId() == SMSG_NPC_VIEWPOINT)
- return npcId;
-
if (diag == NpcDialog::mNpcDialogs.end())
{
- // +++ must be removed SMSG_*
// 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/eathena/npchandler.h b/src/net/eathena/npchandler.h
index f31225de7..e05b93bd0 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -77,7 +77,8 @@ class NpcHandler final : public Ea::NpcHandler
void refine(const int index) const override final;
- BeingId getNpc(Net::MessageIn &msg) override final;
+ BeingId getNpc(Net::MessageIn &msg,
+ const NpcAction action) override final;
void identify(const int index) const override final;