summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-01-24 01:50:13 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-01-24 01:50:13 +0000
commit90c0fb74a317e9c4181d35fead0c7c67e653d9ad (patch)
tree9a55efeedea9b6e2fdb5f7bc6a6ac59aee846f40
parent9f70e690ba0fb0eca7b541c29bd9afb0398368e0 (diff)
downloadmana-90c0fb74a317e9c4181d35fead0c7c67e653d9ad.tar.gz
mana-90c0fb74a317e9c4181d35fead0c7c67e653d9ad.tar.bz2
mana-90c0fb74a317e9c4181d35fead0c7c67e653d9ad.tar.xz
mana-90c0fb74a317e9c4181d35fead0c7c67e653d9ad.zip
Fixed broken communication of attack directions.
-rw-r--r--ChangeLog5
-rw-r--r--src/net/beinghandler.cpp9
-rw-r--r--src/resources/spritedef.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b41d69b4..edc1b310 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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