summaryrefslogtreecommitdiff
path: root/src/net/tmwa/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-09 13:24:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-09 13:24:44 +0300
commitc33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3 (patch)
tree4c62fccf401fbe57d51e0ca5f3ac020e59ced61c /src/net/tmwa/beinghandler.cpp
parent72a83628abdde8cb5eb3e0973677266edf91997d (diff)
downloadmanaverse-c33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3.tar.gz
manaverse-c33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3.tar.bz2
manaverse-c33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3.tar.xz
manaverse-c33fe94a01b7a41de0b46aa1c5bc46f76e58a0b3.zip
Move processBeingChangeDirection from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r--src/net/tmwa/beinghandler.cpp27
1 files changed, 27 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