diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-23 00:46:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-23 00:46:09 +0300 |
commit | 1455c3aec56ebe4ad904685c7cde232ae4176aaa (patch) | |
tree | 71fbaa9338e75b40f43a7f74ecfbed74854a7113 /src | |
parent | 293eda4dc7f7593e67813b5f03d0866dabb5ffa9 (diff) | |
download | manaplus-1455c3aec56ebe4ad904685c7cde232ae4176aaa.tar.gz manaplus-1455c3aec56ebe4ad904685c7cde232ae4176aaa.tar.bz2 manaplus-1455c3aec56ebe4ad904685c7cde232ae4176aaa.tar.xz manaplus-1455c3aec56ebe4ad904685c7cde232ae4176aaa.zip |
eathena: split handler for packets SMSG_BEING_STATUS_CHANGE and SMSG_BEING_STATUS_CHANGE2
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 32 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.h | 2 |
2 files changed, 31 insertions, 3 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index be7899830..bc5987f1c 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -237,10 +237,13 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_BEING_STATUS_CHANGE: - case SMSG_BEING_STATUS_CHANGE2: processBeingStatusChange(msg); break; + case SMSG_BEING_STATUS_CHANGE2: + processBeingStatusChange2(msg); + break; + case SMSG_SKILL_CASTING: processSkillCasting(msg); break; @@ -1040,8 +1043,31 @@ void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) const uint16_t status = msg.readInt16("status"); const int id = msg.readInt32("being id"); const bool flag = msg.readUInt8("flag: 0: stop, 1: start"); - if (status1) - msg.readInt32("total"); + msg.readInt32("total"); + msg.readInt32("left"); + msg.readInt32("val1"); + msg.readInt32("val2"); + msg.readInt32("val3"); + + Being *const dstBeing = actorManager->findBeing(id); + if (dstBeing) + dstBeing->setStatusEffect(status, flag); + BLOCK_END("BeingHandler::processBeingStatusChange") +} + +void BeingHandler::processBeingStatusChange2(Net::MessageIn &msg) +{ + BLOCK_START("BeingHandler::processBeingStatusChange") + if (!actorManager) + { + BLOCK_END("BeingHandler::processBeingStatusChange") + return; + } + + // Status change + const uint16_t status = msg.readInt16("status"); + const int id = msg.readInt32("being id"); + const bool flag = msg.readUInt8("flag: 0: stop, 1: start"); msg.readInt32("left"); msg.readInt32("val1"); msg.readInt32("val2"); diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 9c0d0b920..b4520c201 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -67,6 +67,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processBeingStatusChange(Net::MessageIn &msg); + static void processBeingStatusChange2(Net::MessageIn &msg); + static void processBeingMove2(Net::MessageIn &msg); static void processBeingAction2(Net::MessageIn &msg); |