[colobot] 179/390: Don't require user to launch the SpaceShip before ending the mission, if it has selectable=0

Didier Raboud odyx at moszumanska.debian.org
Fri Jun 12 14:21:43 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 1ae66d39f3452da1be03640f6d4ff9413261b108
Author: krzys-h <krzys_h at interia.pl>
Date:   Sun Nov 9 19:26:36 2014 +0100

    Don't require user to launch the SpaceShip before ending the mission, if it has selectable=0
    
    Closes #376
---
 src/object/robotmain.cpp | 16 ++++++++--------
 src/object/robotmain.h   |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 2af9afe..7782284 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -1240,7 +1240,7 @@ void CRobotMain::ChangePhase(Phase phase)
                 StartDisplayInfo(SATCOM_HUSTON, false);  // shows the instructions
 
             m_sound->StopMusic(0.0f);
-            if (!m_base || loading) StartMusic();
+            if (m_base == nullptr || loading) StartMusic();
         }
         catch(const CLevelParserException& e)
         {
@@ -3696,7 +3696,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
     m_fixScene = fixScene;
 
     g_id = 0;
-    m_base = false;
+    m_base = nullptr;
 
     if (!resetObject)
     {
@@ -4322,7 +4322,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
             {
                 obj->SetDefRank(rankObj);
                 
-                if (type == OBJECT_BASE) m_base = true;
+                if (type == OBJECT_BASE) m_base = obj;
                 
                 Gfx::CameraType cType = line->GetParam("camera")->AsCameraType(Gfx::CAM_TYPE_NULL);
                 if (cType != Gfx::CAM_TYPE_NULL)
@@ -4741,7 +4741,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
 
     m_selectObject = sel;
 
-    if (!m_base     &&  // no main base?
+    if (m_base == nullptr &&  // no main base?
         !m_fixScene)    // interractive scene?
     {
         CObject* obj;
@@ -5924,7 +5924,7 @@ CObject* CRobotMain::IOReadObject(char *line, const char* filename, int objRank)
         }
     }
 
-    if (type == OBJECT_BASE) m_base = true;
+    if (type == OBJECT_BASE) m_base = obj;
 
     obj->Read(line);
 
@@ -5956,7 +5956,7 @@ CObject* CRobotMain::IOReadObject(char *line, const char* filename, int objRank)
 //! Resumes some part of the game
 CObject* CRobotMain::IOReadScene(const char *filename, const char *filecbot)
 {
-    m_base = false;
+    m_base = nullptr;
 
     FILE* file = fopen(filename, "r");
     if (file == NULL) return 0;
@@ -6386,7 +6386,7 @@ Error CRobotMain::CheckEndMission(bool frame)
             if(m_exitAfterMission)
                 m_eventQueue->AddEvent(Event(EVENT_QUIT));
         }
-        if (frame && m_base) return ERR_MISSION_NOTERM;
+        if (frame && m_base != nullptr && m_base->GetSelectable()) return ERR_MISSION_NOTERM;
         if (m_missionResult == ERR_OK) { //mission win?
             m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f));
             if(m_missionTimerEnabled && m_missionTimerStarted) {
@@ -6529,7 +6529,7 @@ Error CRobotMain::CheckEndMission(bool frame)
         return ERR_OK;  // mission ended
     }
 
-    if (frame && m_base) return ERR_MISSION_NOTERM;
+    if (frame && m_base != nullptr && m_base->GetSelectable()) return ERR_MISSION_NOTERM;
 
     if (m_winDelay == 0.0f)
     {
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 875ff51..9522c2b 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -471,7 +471,7 @@ protected:
     float           m_winDelay;
     float           m_lostDelay;
     bool            m_fixScene;        // scene fixed, no interraction
-    bool            m_base;        // OBJECT_BASE exists in mission
+    CObject*        m_base;        // OBJECT_BASE exists in mission
     Math::Point     m_lastMousePos;
     CObject*        m_selectObject;
 

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