From bd2007020b853b4a8c214a6831fa9b9de226cb59 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Apr 2016 21:30:30 +0300 Subject: Sort more packets. Add version checks inside packets. --- src/net/eathena/beingrecv.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/beingrecv.cpp') diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index b52bd698e..be49cd625 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -990,8 +990,18 @@ void BeingRecv::processMonsterHp(Net::MessageIn &msg) { Being *const dstBeing = actorManager->findBeing( msg.readBeingId("monster id")); - const int hp = msg.readInt32("hp"); - const int maxHP = msg.readInt32("max hp"); + int hp; + int maxHP; + if (msg.getVersion() >= 20100126) + { + hp = msg.readInt32("hp"); + maxHP = msg.readInt32("max hp"); + } + else + { + hp = msg.readInt16("hp"); + maxHP = msg.readInt16("max hp"); + } if (dstBeing) { dstBeing->setHP(hp); -- cgit v1.2.3-70-g09d2