[colobot] 300/390: Made powermin and powermax work with cells that are not in bot's power slot

Didier Raboud odyx at moszumanska.debian.org
Fri Jun 12 14:21:57 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 72196b252cd55cdc2690663462e5ff49570c66b7
Author: krzys-h <krzys_h at interia.pl>
Date:   Sat Mar 28 12:21:56 2015 +0100

    Made powermin and powermax work with cells that are not in bot's power slot
---
 src/object/robotmain.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 13aec23..1e2fd57 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -5429,6 +5429,12 @@ void CRobotMain::UpdateAudio(bool frame)
             {
                 energyLevel = power->GetEnergy();
                 if (power->GetType() == OBJECT_ATOMIC) energyLevel *= 100;
+            } else {
+                if(obj->GetType() == OBJECT_POWER || obj->GetType() == OBJECT_ATOMIC)
+                {
+                    energyLevel = obj->GetEnergy();
+                    if (obj->GetType() == OBJECT_ATOMIC) energyLevel *= 100;
+                }
             }
             if (energyLevel < m_audioChange[t].powermin || energyLevel > m_audioChange[t].powermax)
 	            continue;
@@ -5553,6 +5559,12 @@ Error CRobotMain::CheckEndMission(bool frame)
             {
                 energyLevel = power->GetEnergy();
                 if (power->GetType() == OBJECT_ATOMIC) energyLevel *= 100;
+            } else {
+                if(obj->GetType() == OBJECT_POWER || obj->GetType() == OBJECT_ATOMIC)
+                {
+                    energyLevel = obj->GetEnergy();
+                    if (obj->GetType() == OBJECT_ATOMIC) energyLevel *= 100;
+                }
             }
             if (energyLevel < m_endTake[t].powermin || energyLevel > m_endTake[t].powermax) continue;
 

-- 
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