summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-17 22:15:25 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-17 22:15:44 +0200
commitfafaabd67b30e0b4434aa2dc03c8e753ff614bb6 (patch)
tree0e2f613f9ca5cd2ef936d352098580a004d4affb /src/being.cpp
parent9330b50231cb038295681874c3060aa97689f31d (diff)
downloadplus-fafaabd67b30e0b4434aa2dc03c8e753ff614bb6.tar.gz
plus-fafaabd67b30e0b4434aa2dc03c8e753ff614bb6.tar.bz2
plus-fafaabd67b30e0b4434aa2dc03c8e753ff614bb6.tar.xz
plus-fafaabd67b30e0b4434aa2dc03c8e753ff614bb6.zip
Fix attack direction.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 49bcfee90..1d3b78293 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -633,6 +633,10 @@ void Being::handleAttack(Being *victim, int damage,
mActionTime = tick_time;
}
+ Uint8 dir = calcDirection(victim->getTileX(), victim->getTileY());
+ if (dir)
+ setDirection(dir);
+
sound.playSfx(mInfo->getSound((damage > 0) ?
SOUND_EVENT_HIT : SOUND_EVENT_MISS), mX, mY);
}