summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/beinghandler.cpp9
-rw-r--r--src/resources/spritedef.h2
2 files changed, 9 insertions, 2 deletions
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