summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2006-09-20 23:34:11 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2006-09-20 23:34:11 +0000
commit073d6ba7ad9f4052dcefd0fc64fd705b0e9c8f79 (patch)
tree1838ff9e6a2c54519f2b61af8d54388f2feabfde /src/being.cpp
parent0d2c09435711a5bcb4dfbd7d7900de6c415361ee (diff)
downloadMana-073d6ba7ad9f4052dcefd0fc64fd705b0e9c8f79.tar.gz
Mana-073d6ba7ad9f4052dcefd0fc64fd705b0e9c8f79.tar.bz2
Mana-073d6ba7ad9f4052dcefd0fc64fd705b0e9c8f79.tar.xz
Mana-073d6ba7ad9f4052dcefd0fc64fd705b0e9c8f79.zip
tweaks at the animation system (mostly about fixing the looping attack animations of the monsters)
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 1ca8929a..e7b27f43 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -190,10 +190,24 @@ Being::setAction(Uint8 action)
currentAction = ACTION_ATTACK;
break;
}
+ for (int i = 0; i < VECTOREND_SPRITE; i++)
+ {
+ if (mSprites[i])
+ {
+ mSprites[i]->reset();
+ }
+ }
};
break;
case MONSTER_ATTACK:
currentAction = ACTION_ATTACK;
+ for (int i = 0; i < VECTOREND_SPRITE; i++)
+ {
+ if (mSprites[i])
+ {
+ mSprites[i]->reset();
+ }
+ }
break;
case DEAD:
currentAction = ACTION_DEAD;
@@ -205,16 +219,7 @@ Being::setAction(Uint8 action)
for (int i = 0; i < VECTOREND_SPRITE; i++)
{
- if (!mSprites[i])
- continue;
-
- if (currentAction == ACTION_ATTACK ||
- currentAction == ACTION_ATTACK_STAB ||
- currentAction == ACTION_ATTACK_BOW)
- {
- mSprites[i]->play(currentAction, mAttackSpeed);
- }
- else
+ if (mSprites[i])
{
mSprites[i]->play(currentAction);
}