diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-01 21:30:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-01 21:30:30 +0300 |
commit | bd2007020b853b4a8c214a6831fa9b9de226cb59 (patch) | |
tree | ef5a7226508e18d84d68c3b7133cb95f4c304cc2 /src/net/eathena/beingrecv.cpp | |
parent | 6382df8642af1f1650e48106dfecd0cbe51455ae (diff) | |
download | mv-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.gz mv-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.bz2 mv-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.xz mv-bd2007020b853b4a8c214a6831fa9b9de226cb59.zip |
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/beingrecv.cpp')
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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); |