diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2006-12-27 20:39:21 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2006-12-27 20:39:21 +0000 |
commit | b2ef30efb59c8aa4df3bbaab376d46c583a40d98 (patch) | |
tree | bfa5f4b4dbb937b4413e79427bf1bbab8522dbdb /src/net/beinghandler.cpp | |
parent | 8da32105732949b4b0273c718d118bcfae70a1c9 (diff) | |
download | mana-client-b2ef30efb59c8aa4df3bbaab376d46c583a40d98.tar.gz mana-client-b2ef30efb59c8aa4df3bbaab376d46c583a40d98.tar.bz2 mana-client-b2ef30efb59c8aa4df3bbaab376d46c583a40d98.tar.xz mana-client-b2ef30efb59c8aa4df3bbaab376d46c583a40d98.zip |
Client-sided implementation of attacks
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 6d8ff6c6..c6db8e33 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -53,6 +53,7 @@ BeingHandler::BeingHandler() //SMSG_PLAYER_UPDATE_2, //SMSG_PLAYER_MOVE, //0x0119, + GPMSG_BEING_ATTACK, GPMSG_BEING_ENTER, GPMSG_BEING_LEAVE, GPMSG_BEINGS_MOVE, @@ -85,6 +86,9 @@ void BeingHandler::handleMessage(MessageIn &msg) case GPMSG_BEINGS_MOVE: handleBeingsMoveMessage(msg); break; + case GPMSG_BEING_ATTACK: + handleBeingAttackMessage(msg); + break; /* case SMSG_BEING_VISIBLE: @@ -432,10 +436,7 @@ void BeingHandler::handleBeingLeaveMessage(MessageIn &msg) { Being *being = beingManager->findBeing(msg.readShort()); if (!being) return; - if (being == player_node->getTarget()) - { - player_node->stopAttack(); - } + beingManager->destroyBeing(being); } @@ -489,3 +490,11 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) } } } + +void BeingHandler::handleBeingAttackMessage(MessageIn &msg) +{ + Being *being = beingManager->findBeing(msg.readShort()); + if (!being) return; + + being->setAction(Being::ATTACK); +} |