]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.cpp
added simple attack animations
[l2e.git] / src / battle / BattleState.cpp
index 6aeaae5f7e4ee98ac845c79c26f558abefba03c4..1b4401065e9d2c17cc1e8961c8941e1dc00d7c08 100644 (file)
@@ -266,8 +266,12 @@ void BattleState::RenderMonsters(SDL_Surface *screen, const Vector<int> &offset)
 
 void BattleState::RenderHeroes(SDL_Surface *screen, const Vector<int> &offset) {
        for (int i(0); i < numHeroes; ++i) {
-               int row(heroes[i].Health() > 0 ? 0 : 2);
-               heroes[i].Sprite()->DrawCenterBottom(screen, heroesPositions[i] + offset, 1, row);
+               if (HeroAnimationAt(i).Running()) {
+                       HeroAnimationAt(i).DrawCenterBottom(screen, heroesPositions[i] + offset);
+               } else {
+                       int row(heroes[i].Health() > 0 ? 0 : 2);
+                       heroes[i].Sprite()->DrawCenterBottom(screen, heroesPositions[i] + offset, 1, row);
+               }
        }
 }