[colobot] 13/145: Fixed exit after single mission mode

Didier Raboud odyx at moszumanska.debian.org
Mon Jul 11 12:56:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 7fe65067ee06c414e56499c01e65666db176c957
Author: krzys-h <krzys_h at interia.pl>
Date:   Sun Mar 27 13:46:48 2016 +0200

    Fixed exit after single mission mode
---
 src/level/robotmain.cpp | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 1234224..1d51b59 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -231,8 +231,6 @@ CRobotMain::CRobotMain()
 
     m_globalMagnifyDamage = 1.0f;
 
-    m_exitAfterMission = false;
-
     m_autosave = true;
     m_autosaveInterval = 5;
     m_autosaveSlots = 3;
@@ -366,6 +364,13 @@ void CRobotMain::ChangePhase(Phase phase)
     bool resetWorld = false;
     if ((IsPhaseWithWorld(m_phase) || IsPhaseWithWorld(phase)) && !IsInSimulationConfigPhase(m_phase) && !IsInSimulationConfigPhase(phase))
     {
+        if (IsPhaseWithWorld(m_phase) && !IsPhaseWithWorld(phase) && m_exitAfterMission)
+        {
+            GetLogger()->Info("Mission finished in single mission mode, exiting\n");
+            m_eventQueue->AddEvent(Event(EVENT_QUIT));
+            return;
+        }
+
         GetLogger()->Info("Reseting world on phase change...\n");
         resetWorld = true;
     }
@@ -5105,8 +5110,6 @@ Error CRobotMain::CheckEndMission(bool frame)
                             m_missionTimerEnabled = m_missionTimerStarted = false;
                             m_winDelay  = m_endTakeWinDelay;  // wins in two seconds
                             m_lostDelay = 0.0f;
-                            if (m_exitAfterMission)
-                                m_eventQueue->AddEvent(Event(EVENT_QUIT));
                             m_displayText->SetEnable(false);
                         }
                         m_missionResult = ERR_OK;
@@ -5139,8 +5142,6 @@ Error CRobotMain::CheckEndMission(bool frame)
         }
         m_missionTimerEnabled = m_missionTimerStarted = false;
         m_displayText->SetEnable(false);
-        if (m_exitAfterMission)
-            m_eventQueue->AddEvent(Event(EVENT_QUIT));
         return INFO_LOSTq;
     }
 
@@ -5154,8 +5155,6 @@ Error CRobotMain::CheckEndMission(bool frame)
         }
         m_missionTimerEnabled = m_missionTimerStarted = false;
         m_displayText->SetEnable(false);
-        if (m_exitAfterMission)
-            m_eventQueue->AddEvent(Event(EVENT_QUIT));
         return INFO_LOST;
     }
 
@@ -5167,8 +5166,6 @@ Error CRobotMain::CheckEndMission(bool frame)
             m_lostDelay = 0.0f;
             m_missionTimerEnabled = m_missionTimerStarted = false;
             m_displayText->SetEnable(false);
-            if (m_exitAfterMission)
-                m_eventQueue->AddEvent(Event(EVENT_QUIT));
             return ERR_OK;  // mission ended
         }
 
@@ -5194,8 +5191,6 @@ Error CRobotMain::CheckEndMission(bool frame)
             m_winDelay  = m_endTakeWinDelay;  // wins in two seconds
             m_lostDelay = 0.0f;
         }
-        if (m_exitAfterMission)
-            m_eventQueue->AddEvent(Event(EVENT_QUIT));
         m_displayText->SetEnable(false);
         return ERR_OK;  // mission ended
     }

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