From 68581ace3255ea4d8b0f0e5b33a33633a27b8e42 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 Jan 2015 23:48:46 +0300 Subject: eathena: add packet SMSG_NPC_AREA 0x0b0b Change protocol version to 5. --- src/net/eathena/npchandler.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/net/eathena/npchandler.cpp') diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 0bb2e2587..e797c0477 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -22,6 +22,8 @@ #include "net/eathena/npchandler.h" +#include "actormanager.h" + #include "being/localplayer.h" #include "gui/windows/npcdialog.h" @@ -56,6 +58,7 @@ NpcHandler::NpcHandler() : SMSG_NPC_CLOSE_TIMEOUT, SMSG_NPC_COMMAND, SMSG_NPC_CHANGETITLE, + SMSG_NPC_AREA, 0 }; handledMessages = _messages; @@ -114,6 +117,10 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) processChangeTitle(msg); break; + case SMSG_NPC_AREA: + processArea(msg); + break; + default: break; } @@ -351,4 +358,16 @@ void NpcHandler::processNpcCloseTimeout(Net::MessageIn &msg) msg.readInt32("npc id"); } +void NpcHandler::processArea(Net::MessageIn &msg) +{ + const int len = msg.readInt16("len"); + if (len < 12) + return; + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("npc id")); + const int area = msg.readInt32("area size"); + if (dstBeing) + dstBeing->setAreaSize(area); +} + } // namespace EAthena -- cgit v1.2.3-60-g2f50