diff options
author | Jared Adams <jaxad0127@gmail.com> | 2008-10-24 19:13:04 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2008-10-24 19:13:04 +0000 |
commit | f8f3e17f72d1216bacd5aaa975789b0b790068f6 (patch) | |
tree | f75af23708c746f0139e044ebccc78ceac36c6e2 /src/net/beinghandler.cpp | |
parent | 0b2235dfff7f7c0f534746271ff66275297fd328 (diff) | |
download | mana-f8f3e17f72d1216bacd5aaa975789b0b790068f6.tar.gz mana-f8f3e17f72d1216bacd5aaa975789b0b790068f6.tar.bz2 mana-f8f3e17f72d1216bacd5aaa975789b0b790068f6.tar.xz mana-f8f3e17f72d1216bacd5aaa975789b0b790068f6.zip |
Made it so the player will auto face its target
Fixed it so the correct direction will be
Patch by Chuck Miller
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index fc3c7d1e..0873764e 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -257,7 +257,7 @@ void BeingHandler::handleBeingAttackMessage(MessageIn &msg) int attackType = msg.readInt8(); if (!being) return; - + switch (direction) { case DIRECTION_UP: being->setDirection(Being::UP); break; @@ -327,5 +327,12 @@ void BeingHandler::handleBeingDirChangeMessage(MessageIn &msg) { Being *being = beingManager->findBeing(msg.readInt16()); if (!being) return; - being->setDirection(msg.readInt8()); + int data = msg.readInt8(); + switch (data) + { + case DIRECTION_UP: being->setDirection(Being::UP); break; + case DIRECTION_DOWN: being->setDirection(Being::DOWN); break; + case DIRECTION_LEFT: being->setDirection(Being::LEFT); break; + case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; + } } |