From c33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 9 Sep 2014 13:24:44 +0300 Subject: Move processBeingChangeDirection from ea namespace into eathena and tmwa. --- src/net/ea/beinghandler.cpp | 27 --------------------------- src/net/ea/beinghandler.h | 2 -- src/net/eathena/beinghandler.cpp | 27 +++++++++++++++++++++++++++ src/net/eathena/beinghandler.h | 2 ++ src/net/tmwa/beinghandler.cpp | 27 +++++++++++++++++++++++++++ src/net/tmwa/beinghandler.h | 2 ++ 6 files changed, 58 insertions(+), 29 deletions(-) (limited to 'src/net') diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 554cbf730..b878ed246 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -434,33 +434,6 @@ void BeingHandler::processPlayerGuilPartyInfo(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processPlayerGuilPartyInfo") } -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( - msg.readUInt8("direction") & 0x0FU); - dstBeing->setDirection(dir); - if (localPlayer) - localPlayer->imitateDirection(dstBeing, dir); - BLOCK_END("BeingHandler::processBeingChangeDirection") -} - void BeingHandler::processPlayerStop(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processPlayerStop") diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h index e68e382f6..05e3b5af4 100644 --- a/src/net/ea/beinghandler.h +++ b/src/net/ea/beinghandler.h @@ -64,8 +64,6 @@ class BeingHandler notfinal : public Net::BeingHandler virtual void processPlayerGuilPartyInfo(Net::MessageIn &msg) const; - virtual void processBeingChangeDirection(Net::MessageIn &msg) const; - virtual void processPlayerStop(Net::MessageIn &msg) const; virtual void processPlayerMoveToAttack(Net::MessageIn &msg) const; diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 958cd1391..c68be6f24 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -1110,4 +1110,31 @@ void BeingHandler::processRanksList(Net::MessageIn &msg) const msg.readInt32("my points"); } +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( + msg.readUInt8("direction") & 0x0FU); + dstBeing->setDirection(dir); + if (localPlayer) + localPlayer->imitateDirection(dstBeing, dir); + BLOCK_END("BeingHandler::processBeingChangeDirection") +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 344a672b1..4dceb3388 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -69,6 +69,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processSkillAutoCast(Net::MessageIn &msg) const; void processRanksList(Net::MessageIn &msg) const; + + void processBeingChangeDirection(Net::MessageIn &msg) const; }; } // namespace EAthena 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( + 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 -- cgit v1.2.3-70-g09d2