diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 19:26:41 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 19:26:41 +0000 |
commit | fd279ae77295a6babedd31202078862eabcada9f (patch) | |
tree | d3ebc7572ac92990375a461cbca198bf9fdde3cc /src/net/beinghandler.cpp | |
parent | 07b6070c25faedd78c2e26825bd700dc294f00cf (diff) | |
download | mana-fd279ae77295a6babedd31202078862eabcada9f.tar.gz mana-fd279ae77295a6babedd31202078862eabcada9f.tar.bz2 mana-fd279ae77295a6babedd31202078862eabcada9f.tar.xz mana-fd279ae77295a6babedd31202078862eabcada9f.zip |
Handle "beings move" messages.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index c85e8893..93f5f1a8 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -54,6 +54,7 @@ BeingHandler::BeingHandler() //SMSG_PLAYER_MOVE, //0x0119, GPMSG_BEING_ENTER, + GPMSG_BEINGS_MOVE, 0 }; handledMessages = _messages; @@ -61,11 +62,13 @@ BeingHandler::BeingHandler() void BeingHandler::handleMessage(MessageIn &msg) { + /* Uint32 id; Uint16 job, speed; Sint16 param1; Sint8 type; Being *srcBeing, *dstBeing; + */ switch (msg.getId()) { @@ -73,6 +76,11 @@ void BeingHandler::handleMessage(MessageIn &msg) handleBeingEnterMessage(msg); break; + case GPMSG_BEINGS_MOVE: + handleBeingsMoveMessage(msg); + break; + + /* case SMSG_BEING_VISIBLE: case SMSG_BEING_MOVE: // Information about a being in range @@ -377,6 +385,7 @@ void BeingHandler::handleMessage(MessageIn &msg) msg.readShort(), msg.readShort(), msg.readShort(), msg.readByte()); break; + */ } } @@ -402,3 +411,18 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg) being->setHairColor(msg.readByte()); being->setSex(msg.readByte()); } + +void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) +{ + for (int nb = (msg.getLength() - 2) / (4 + 4 * 2); nb > 0; --nb) + { + Uint32 id = msg.readLong(); + Being *being = beingManager->findBeing(id); + if (!being) continue; + int sx = msg.readShort(), sy = msg.readShort(), + dx = msg.readShort(), dy = msg.readShort(); + being->mX = sx / 32; + being->mY = sy / 32; + being->setDestination(dx / 32, dy / 32); + } +} |