From c7c2c069010ca30352e25fa8e5010d556192835b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Sep 2014 23:06:16 +0300 Subject: Move processBeingMove2 from ea namespace into eathena and tmwa. --- src/net/eathena/beinghandler.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/net/eathena/beinghandler.cpp') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index e6e16e0ad..bdfeb813a 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -910,4 +910,44 @@ void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processBeingStatusChange") } +void BeingHandler::processBeingMove2(Net::MessageIn &msg) const +{ + BLOCK_START("BeingHandler::processBeingMove2") + if (!actorManager) + { + BLOCK_END("BeingHandler::processBeingMove2") + return; + } + + /* + * A simplified movement packet, used by the + * later versions of eAthena for both mobs and + * players + */ + Being *const dstBeing = actorManager->findBeing(msg.readInt32("being id")); + + /* + * This packet doesn't have enough info to actually + * create a new being, so if the being isn't found, + * we'll just pretend the packet didn't happen + */ + + if (!dstBeing) + { + BLOCK_END("BeingHandler::processBeingMove2") + return; + } + + uint16_t srcX, srcY, dstX, dstY; + msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); + msg.readInt32("tick"); + + dstBeing->setAction(BeingAction::STAND, 0); + dstBeing->setTileCoords(srcX, srcY); + dstBeing->setDestination(dstX, dstY); + if (dstBeing->getType() == ActorType::PLAYER) + dstBeing->setMoveTime(); + BLOCK_END("BeingHandler::processBeingMove2") +} + } // namespace EAthena -- cgit v1.2.3-60-g2f50