summaryrefslogtreecommitdiff
path: root/src/net/eathena/npchandler.cpp
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/npchandler.cpp
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/npchandler.cpp')
-rw-r--r--src/net/eathena/npchandler.cpp21
1 files changed, 4 insertions, 17 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;