diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-03 19:50:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-03 19:50:26 +0300 |
commit | f26d3df5feef535d3eede09f581a5cbc08cae2a1 (patch) | |
tree | 79a7776b5d22fd34a1f7e105a941a22de9ef9176 /src/net/eathena/beingrecv.cpp | |
parent | 74e3ec3edcae04931238c2e6be93c60c087571e9 (diff) | |
download | mv-f26d3df5feef535d3eede09f581a5cbc08cae2a1.tar.gz mv-f26d3df5feef535d3eede09f581a5cbc08cae2a1.tar.bz2 mv-f26d3df5feef535d3eede09f581a5cbc08cae2a1.tar.xz mv-f26d3df5feef535d3eede09f581a5cbc08cae2a1.zip |
Separate being and monster hp packets.
Diffstat (limited to 'src/net/eathena/beingrecv.cpp')
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 86786f1fa..c1dcdbd83 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -1066,10 +1066,10 @@ void BeingRecv::processBeingAction2(Net::MessageIn &msg) BLOCK_END("BeingRecv::processBeingAction2") } -void BeingRecv::processMonsterHp(Net::MessageIn &msg) +void BeingRecv::processBeingHp(Net::MessageIn &msg) { Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("monster id")); + msg.readBeingId("being id")); int hp; int maxHP; if (msg.getVersion() >= 20100126) @@ -1089,6 +1089,19 @@ void BeingRecv::processMonsterHp(Net::MessageIn &msg) } } +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"); + if (dstBeing) + { + dstBeing->setHP(hp); + dstBeing->setMaxHP(maxHP); + } +} + void BeingRecv::processSkillAutoCast(Net::MessageIn &msg) { const int id = msg.readInt16("skill id"); |