summaryrefslogtreecommitdiff
path: root/src/net/eathena/beingrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-01 21:30:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-01 21:30:30 +0300
commitbd2007020b853b4a8c214a6831fa9b9de226cb59 (patch)
treeef5a7226508e18d84d68c3b7133cb95f4c304cc2 /src/net/eathena/beingrecv.cpp
parent6382df8642af1f1650e48106dfecd0cbe51455ae (diff)
downloadplus-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.gz
plus-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.bz2
plus-bd2007020b853b4a8c214a6831fa9b9de226cb59.tar.xz
plus-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.cpp14
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);