diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 27 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.h | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index ef8d3e780..9d45c6aa8 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -1063,4 +1063,31 @@ void BeingHandler::processBeingMove2(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processBeingMove2") } +void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg) const +{ + BLOCK_START("BeingHandler::processBeingChangeDirection") + if (!actorManager) + { + BLOCK_END("BeingHandler::processBeingChangeDirection") + return; + } + + Being *const dstBeing = actorManager->findBeing(msg.readInt32("being id")); + + if (!dstBeing) + { + BLOCK_END("BeingHandler::processBeingChangeDirection") + return; + } + + msg.readInt16("unused"); + + const uint8_t dir = static_cast<uint8_t>( + msg.readUInt8("direction") & 0x0FU); + dstBeing->setDirection(dir); + if (localPlayer) + localPlayer->imitateDirection(dstBeing, dir); + BLOCK_END("BeingHandler::processBeingChangeDirection") +} + } // namespace TmwAthena diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index ca7da87b7..a9f734e55 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -63,6 +63,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processBeingStatusChange(Net::MessageIn &msg) const; void processBeingMove2(Net::MessageIn &msg) const; + + void processBeingChangeDirection(Net::MessageIn &msg) const; }; } // namespace TmwAthena |