summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp40
-rw-r--r--src/net/tmwa/beinghandler.h2
2 files changed, 42 insertions, 0 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 426ed7a24..90ec926ba 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -1019,4 +1019,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 TmwAthena
diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h
index af7004fd5..34b464c41 100644
--- a/src/net/tmwa/beinghandler.h
+++ b/src/net/tmwa/beinghandler.h
@@ -59,6 +59,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler
void processSkillCasting(Net::MessageIn &msg) const;
void processBeingStatusChange(Net::MessageIn &msg) const;
+
+ void processBeingMove2(Net::MessageIn &msg) const;
};
} // namespace TmwAthena