summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-29 23:59:08 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-29 23:59:08 +0000
commite8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3 (patch)
treee8dc775e12f6b4eb0a6d56448f05286c774bbb8a /src/being.cpp
parent0e8c09433f3a193b5a94a1ad572d8237113cdfbf (diff)
downloadmana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.gz
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.bz2
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.xz
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.zip
Merged trunk changes from revision 2618 to 2716 into the 0.1.0 branch.
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 982b0ebf..4d542753 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -331,10 +331,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;
@@ -346,16 +360,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);
}