[Orxonox-commit 6540] r11181 - code/branches/bindermFS16/src/orxonox

binderm at orxonox.net binderm at orxonox.net
Tue May 10 12:29:37 CEST 2016


Author: binderm
Date: 2016-05-10 12:29:37 +0200 (Tue, 10 May 2016)
New Revision: 11181

Modified:
   code/branches/bindermFS16/src/orxonox/LevelManager.cc
Log:
some minor changes

Modified: code/branches/bindermFS16/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelManager.cc	2016-05-10 10:09:09 UTC (rev 11180)
+++ code/branches/bindermFS16/src/orxonox/LevelManager.cc	2016-05-10 10:29:37 UTC (rev 11181)
@@ -52,7 +52,7 @@
     LevelStatus::LevelStatus()
     {
         this->won = false;
-        this->nextLevels.insert(this->nextLevels.begin(),-1);
+        this->nextLevels.insert(this->nextLevels.begin(),1);
     }
 
     LevelStatus::~LevelStatus()
@@ -62,14 +62,12 @@
     //check if index level is activated...
     int LevelManager::missionactivate(int index)
     {
-            return index+1;
 
-
         if (allLevelStatus_[index].won)
             return 1;
 
         //check if level is activated
-        for(unsigned int i=1;i<allLevelStatus_.size();i++)
+        for(unsigned int i=0;i<allLevelStatus_.size();i++)
         {
             std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
             bool won=allLevelStatus_[i].won;
@@ -78,14 +76,14 @@
         };
 
         //check if level visible but not activated
-        for(unsigned int i=1;i<allLevelStatus_.size();i++)
+        for(unsigned int i=0;i<allLevelStatus_.size();i++)
         {
             std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
             bool won=allLevelStatus_[i].won;
             if(nextLevels[index]==2&&won)
                 return 2;
         };
-        return false;
+        return 0;
     }
 
     //updates the won variable of the corresponding LevelStatus in allLevelStatus_
@@ -101,8 +99,15 @@
     {
         LevelStatus level;
         allLevelStatus_.assign (10,level);
-        allLevelStatus_[1].won=true;
+        allLevelStatus_[0].won=true;
 
+        
+        allLevelStatus_[1].nextLevels.push_back(2);
+        allLevelStatus_[1].nextLevels.push_back(2);
+        allLevelStatus_[1].nextLevels.push_back(1);
+        allLevelStatus_[1].nextLevels.push_back(2);
+
+
     }
 
 




More information about the Orxonox-commit mailing list