]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.cpp
switched geometric scalars from floating to fixed
[l2e.git] / src / battle / BattleState.cpp
index 0171e1480f56a7d52b905a86e577525d0a2597a0..cfac62d0b1fb0f655ffc33f5db678886990da882 100644 (file)
@@ -24,7 +24,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 +192,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 +210,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 +389,7 @@ void BattleState::HandleEvents(const Input &input) {
 
 }
 
-void BattleState::UpdateWorld(float deltaT) {
+void BattleState::UpdateWorld(Uint32 deltaT) {
 
 }
 
@@ -438,7 +438,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 {