X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.cpp;h=fd4be082847813a5c41b16d1dd1155f54b64a572;hb=6a3c11d028e0c5f69f910cee37cbf6eb6d5e04d9;hp=bf2d2c1ff1c6d084cef55c91fdc6b7b038a588ad;hpb=fa2eb577b1b5356b8f4b1c23b52f673900ae6b71;p=l2e.git diff --git a/src/battle/BattleState.cpp b/src/battle/BattleState.cpp index bf2d2c1..fd4be08 100644 --- a/src/battle/BattleState.cpp +++ b/src/battle/BattleState.cpp @@ -449,10 +449,8 @@ void BattleState::RenderMonsters(SDL_Surface *screen, const Vector &offset) for (vector::size_type i(0), end(monsters.size()); i < end; ++i) { if (MonsterPositionOccupied(i)) { // TODO: better solution for running animations - if (monsters[i].AttackAnimation() && monsters[i].AttackAnimation()->Running()) { - monsters[i].AttackAnimation()->DrawCenter(screen, monsterPositions[i] + offset); - } else if (monsters[i].SpellAnimation() && monsters[i].SpellAnimation()->Running()) { - monsters[i].SpellAnimation()->DrawCenter(screen, monsterPositions[i] + offset); + if (monsters[i].GetAnimation().Running()) { + monsters[i].GetAnimation().DrawCenter(screen, monsterPositions[i] + offset); } else { monsters[i].Sprite()->DrawCenter(screen, monsterPositions[i] + offset); } @@ -463,10 +461,8 @@ void BattleState::RenderMonsters(SDL_Surface *screen, const Vector &offset) void BattleState::RenderHeroes(SDL_Surface *screen, const Vector &offset) { assert(screen); for (int i(0); i < numHeroes; ++i) { - if (heroes[i].AttackAnimation() && heroes[i].AttackAnimation()->Running()) { - heroes[i].AttackAnimation()->DrawCenter(screen, heroesPositions[i] + offset); - } else if (heroes[i].SpellAnimation() && heroes[i].SpellAnimation()->Running()) { - heroes[i].SpellAnimation()->DrawCenter(screen, heroesPositions[i] + offset); + if (heroes[i].GetAnimation().Running()) { + heroes[i].GetAnimation().DrawCenter(screen, heroesPositions[i] + offset); } else { int row(heroes[i].Health() > 0 ? 0 : 2); heroes[i].Sprite()->DrawCenter(screen, heroesPositions[i] + offset, 1, row);