diff options
author | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-07-22 18:05:08 +0000 |
---|---|---|
committer | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-07-22 18:05:08 +0000 |
commit | a73a655f398ae9fae01253dec1cc1f9bb1d44ea7 (patch) | |
tree | 87acb37b62c2262073788ec9a858b73e74074cf4 /src/net/beinghandler.cpp | |
parent | 877188e5636738db262fdf55a9ed5d794ca7f5b8 (diff) | |
download | mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.gz mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.bz2 mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.xz mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.zip |
Added support for the new eAthena version
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index f3c0cfb4..778c8cfe 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -45,6 +45,7 @@ BeingHandler::BeingHandler() static const Uint16 _messages[] = { SMSG_BEING_VISIBLE, SMSG_BEING_MOVE, + SMSG_BEING_MOVE2, SMSG_BEING_REMOVE, SMSG_BEING_ACTION, SMSG_BEING_LEVELUP, @@ -164,6 +165,33 @@ void BeingHandler::handleMessage(MessageIn *msg) msg->readInt8(); // unknown / sit break; + case SMSG_BEING_MOVE2: + /* + * A simplified movement packet, used by the + * later versions of eAthena for both mobs and + * players + */ + dstBeing = beingManager->findBeing(msg->readInt32()); + + Uint16 srcX, srcY, dstX, dstY; + msg->readCoordinatePair(srcX, srcY, dstX, dstY); + msg->readInt32(); // Server tick + + /* + * 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) { + dstBeing->setAction(Being::STAND); + dstBeing->mX = srcX; + dstBeing->mY = srcY; + dstBeing->setDestination(dstX, dstY); + } + + break; + case SMSG_BEING_REMOVE: // A being should be removed or has died dstBeing = beingManager->findBeing(msg->readInt32()); |