]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.cpp
removed lazy fwd headers
[l2e.git] / src / battle / BattleState.cpp
index 0171e1480f56a7d52b905a86e577525d0a2597a0..66097fbd46d05a8d5315196fb161fef1bc5a34cb 100644 (file)
@@ -12,6 +12,7 @@
 #include "../common/Spell.h"
 #include "../graphics/Frame.h"
 #include "../graphics/Sprite.h"
+#include "../math/Vector.h"
 
 #include <algorithm>
 #include <cassert>
@@ -24,7 +25,7 @@ using common::Inventory;
 using common::Item;
 using common::Spell;
 using common::Stats;
-using geometry::Vector;
+using math::Vector;
 using graphics::Menu;
 
 using std::rand;
@@ -192,7 +193,7 @@ void BattleState::CalculateAttackOrder() {
                attackOrder.push_back(Order(Order::MONSTER, i));
                MonsterAt(i).GetAttackChoice() = AttackChoice(this);
        }
-       if (capsule.Health() > 0) {
+       if (capsule.Active() && capsule.Health() > 0) {
                attackOrder.push_back(Order(Order::CAPSULE));
        }
        std::sort(attackOrder.begin(), attackOrder.end(), OrderCompare(this));
@@ -210,7 +211,7 @@ void BattleState::NextAttack() {
                } else if (attackOrder[attackCursor].IsHero()) {
                        if (HeroAt(attackOrder[attackCursor].index).Health() > 0) break;
                } else {
-                       if (capsule.Health() > 0) break;
+                       if (capsule.Active() && capsule.Health() > 0) break;
                }
                ++attackCursor;
        }
@@ -389,7 +390,7 @@ void BattleState::HandleEvents(const Input &input) {
 
 }
 
-void BattleState::UpdateWorld(float deltaT) {
+void BattleState::UpdateWorld(Uint32 deltaT) {
 
 }
 
@@ -438,7 +439,7 @@ void BattleState::RenderHeroes(SDL_Surface *screen, const Vector<int> &offset) {
 }
 
 void BattleState::RenderCapsule(SDL_Surface *screen, const Vector<int> &offset) {
-       if (capsule.Health() <= 0) return;
+       if (!capsule.Active() || capsule.Health() <= 0) return;
        if (capsule.GetAnimation().Running()) {
                capsule.GetAnimation().DrawCenter(screen, capsule.Position() + offset);
        } else {