diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-06 00:09:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:58 +0300 |
commit | 1ec5a1847a7c226d6dfee2a5d46c121a9a037161 (patch) | |
tree | f38c9c3e75b1c89af7c0e2787cdc07e7629badbc /src/net/eathena/beinghandler.cpp | |
parent | 298e63668f6fc6944dde59dd82bc99cb8199887c (diff) | |
download | mv-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.gz mv-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.bz2 mv-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.xz mv-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.zip |
eathena: add packet SMSG_MONSTER_HP 0x0977.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index b856bc575..baaa3eccc 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -221,6 +221,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processMapTypeProperty(msg); break; + case SMSG_MONSTER_HP: + processMonsterHp(msg); + break; + default: break; } @@ -1047,4 +1051,17 @@ void BeingHandler::processBeingAction2(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processBeingAction") } +void BeingHandler::processMonsterHp(Net::MessageIn &msg) const +{ + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("monster id")); + const int hp = msg.readInt32("hp"); + const int maxHP = msg.readInt32("max hp"); + if (dstBeing) + { + dstBeing->setHP(hp); + dstBeing->setMaxHP(maxHP); + } +} + } // namespace EAthena |