[colobot] 195/390: Fixed DefenseTower empty cell detection (#378)
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:21:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit a952e0ec547a7e984f86a907102ed9560e1f89b5
Author: krzys-h <krzys_h at interia.pl>
Date: Mon Nov 10 19:38:11 2014 +0100
Fixed DefenseTower empty cell detection (#378)
---
src/object/auto/autotower.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index c06fa55..7e584f9 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -134,7 +134,7 @@ bool CAutoTower::EventProcess(const Event &event)
power = m_object->GetPower();
if ( power != 0 )
{
- energy = power->GetEnergy();
+ energy = power->GetEnergy()*power->GetCapacity();
}
if ( energy >= ENERGY_FIRE )
{
@@ -174,7 +174,7 @@ bool CAutoTower::EventProcess(const Event &event)
power = m_object->GetPower();
if ( power != 0 )
{
- energy = power->GetEnergy();
+ energy = power->GetEnergy()*power->GetCapacity();
}
target = SearchTarget(m_targetPos);
@@ -329,13 +329,13 @@ Error CAutoTower::GetError()
}
power = m_object->GetPower();
- if ( power == 0 )
+ if ( power == nullptr )
{
return ERR_TOWER_POWER; // no battery
}
else
{
- if ( power->GetEnergy() < ENERGY_FIRE )
+ if ( power->GetEnergy()*power->GetCapacity() < ENERGY_FIRE )
{
return ERR_TOWER_ENERGY; // not enough energy
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list