diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 11:39:53 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 11:39:53 +0000 |
commit | 71bded93f43a02b167ec2a9a46b90a5fcc842180 (patch) | |
tree | a1ad8743b3eacfb532e07c5cfb1296815879e269 /src/net | |
parent | fe682b5d44571749d8b28c42c7a9ec803324a672 (diff) | |
download | mana-client-71bded93f43a02b167ec2a9a46b90a5fcc842180.tar.gz mana-client-71bded93f43a02b167ec2a9a46b90a5fcc842180.tar.bz2 mana-client-71bded93f43a02b167ec2a9a46b90a5fcc842180.tar.xz mana-client-71bded93f43a02b167ec2a9a46b90a5fcc842180.zip |
Added support for leaving beings.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 17 | ||||
-rw-r--r-- | src/net/beinghandler.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index ac2801c2..59a4fa9a 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_BEING_LEAVE, GPMSG_BEINGS_MOVE, 0 }; @@ -76,6 +77,10 @@ void BeingHandler::handleMessage(MessageIn &msg) handleBeingEnterMessage(msg); break; + case GPMSG_BEING_LEAVE: + handleBeingLeaveMessage(msg); + break; + case GPMSG_BEINGS_MOVE: handleBeingsMoveMessage(msg); break; @@ -412,6 +417,18 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg) being->setSex(msg.readByte()); } +void BeingHandler::handleBeingLeaveMessage(MessageIn &msg) +{ + msg.readByte(); // type, assume player for now, TODO + Being *being = beingManager->findBeing(msg.readLong()); + if (!being) return; + if (being == player_node->getTarget()) + { + player_node->stopAttack(); + } + beingManager->destroyBeing(being); +} + void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) { for (int nb = (msg.getLength() - 2) / (4 + 4 * 2); nb > 0; --nb) diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index 0b0d10b9..59539ffe 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -35,6 +35,7 @@ class BeingHandler : public MessageHandler private: void handleBeingEnterMessage(MessageIn &msg); + void handleBeingLeaveMessage(MessageIn &msg); void handleBeingsMoveMessage(MessageIn &msg); }; |