From 0fd358d0ebeb02f232f51eb669959c4d210f15cb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Sep 2014 00:11:30 +0300 Subject: eathena: read whole packet in processBeingChangeLook. --- src/net/eathena/beinghandler.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 7104298a8..31cc4fc6a 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -264,9 +264,6 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg) const Being *const dstBeing = actorManager->findBeing( msg.readInt32("being id")); - if (!dstBeing) - return; - const uint8_t type = msg.readUInt8("type"); int id = 0; unsigned int id2 = 0U; @@ -281,13 +278,14 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg) const else { // SMSG_BEING_CHANGE_LOOKS2 id = msg.readInt16("id1"); - if (type == 2) - id2 = msg.readInt16("id2"); - else + id2 = msg.readInt16("id2"); + if (type != 2) id2 = 1; -// color.clear(); } + if (!dstBeing) + return; + if (dstBeing->getType() == ActorType::PLAYER) dstBeing->setOtherTime(); -- cgit v1.2.3-70-g09d2