From a80d52c7b85e3e844a0185eff53ec65b8a176bee Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 6 Sep 2014 20:49:52 +0300 Subject: eathena: fix packet SMSG_NPC_VIEWPOINT 0x0144. --- src/net/eathena/npchandler.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/net/eathena/npchandler.cpp') diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index a15d6480e..5947c967b 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -199,17 +199,19 @@ void NpcHandler::sellItem(const int beingId A_UNUSED, int NpcHandler::getNpc(Net::MessageIn &msg) { if (msg.getId() == SMSG_NPC_CHOICE - || msg.getId() == SMSG_NPC_MESSAGE - || msg.getId() == SMSG_NPC_VIEWPOINT) + || msg.getId() == SMSG_NPC_MESSAGE) { - msg.readInt16(); // length + msg.readInt16("len"); } - const int npcId = msg.readInt32(); + const int npcId = msg.readInt32("npc id"); const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); mDialog = nullptr; + if (msg.getId() == SMSG_NPC_VIEWPOINT) + return npcId; + if (diag == NpcDialog::mNpcDialogs.end()) { // Empty dialogs don't help @@ -255,11 +257,14 @@ void NpcHandler::processNpcCutin(Net::MessageIn &msg A_UNUSED, void NpcHandler::processNpcViewPoint(Net::MessageIn &msg A_UNUSED, const int npcId A_UNUSED) { - msg.readInt32(); // type - msg.readInt32(); // x - msg.readInt32(); // y - msg.readUInt8(); // byte - msg.readInt32(); // color + // +++ probably need add nav point and start moving to it + msg.readInt32("type"); // 0 display for 15 sec, + // 1 display until teleport, + // 2 remove + msg.readInt32("x"); + msg.readInt32("y"); + msg.readUInt8("number"); // can be used for scripts + msg.readInt32("color"); } } // namespace EAthena -- cgit v1.2.3-60-g2f50