diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/net/beinghandler.cpp | 9 | ||||
-rw-r--r-- | src/resources/spritedef.h | 2 |
3 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2007-01-24 Philipp Sehmisch <tmw@crushnet.org> + + * src/net/beinghandler.cpp, src/resources/spritedef.h: Fixed + broken communication of attack directions. + 2007-01-20 Philipp Sehmisch <tmw@crushnet.org> * data/items.xml: Added max-per-slot property to all items. diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 37c02dc3..879c8a46 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -566,7 +566,14 @@ void BeingHandler::handleBeingAttackMessage(MessageIn &msg) if (!being) return; being->setAction(Being::ATTACK); - being->setDirection(msg.readInt8()); + int direction = msg.readInt8(); + switch (direction) + { + 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; + } } void BeingHandler::handleBeingsDamageMessage(MessageIn &msg) diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 4f316875..5eeaf744 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -57,8 +57,8 @@ enum SpriteAction enum SpriteDirection { DIRECTION_DEFAULT = 0, - DIRECTION_DOWN, DIRECTION_UP, + DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_INVALID |