summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-10-16 17:57:12 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2010-10-16 17:57:55 +0200
commitbdf409c9c4ce083881133879947cc0a6c2cce0f1 (patch)
tree6ff1966edd358718f9c47321a7386b4459282355
parent5958c2f20b4c4c7080e525bab314b1e6aa5ddd0e (diff)
downloadmana-bdf409c9c4ce083881133879947cc0a6c2cce0f1.tar.gz
mana-bdf409c9c4ce083881133879947cc0a6c2cce0f1.tar.bz2
mana-bdf409c9c4ce083881133879947cc0a6c2cce0f1.tar.xz
mana-bdf409c9c4ce083881133879947cc0a6c2cce0f1.zip
Fixing wrong SpriteDirection of attacking monsters
Reviewed-by: Bertram
-rw-r--r--src/being.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/being.cpp b/src/being.cpp
index a3e91147..f2d95c4a 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -448,22 +448,20 @@ void Being::setAction(Action action, int attackType)
void Being::setDirection(Uint8 direction)
{
- if (mDirection == direction)
- return;
+ if (Net::getNetworkType() == ServerInfo::MANASERV)
+ {
+ if (mDirection == direction)
+ return;
+ }
mDirection = direction;
- // if the direction does not change much, keep the common component
- int mFaceDirection = mDirection & direction;
- if (!mFaceDirection)
- mFaceDirection = direction;
-
SpriteDirection dir;
- if (mFaceDirection & UP)
+ if (mDirection & UP)
dir = DIRECTION_UP;
- else if (mFaceDirection & DOWN)
+ else if (mDirection & DOWN)
dir = DIRECTION_DOWN;
- else if (mFaceDirection & RIGHT)
+ else if (mDirection & RIGHT)
dir = DIRECTION_RIGHT;
else
dir = DIRECTION_LEFT;