Index: code/branches/bindermFS16/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelManager.cc	(revision 11188)
+++ code/branches/bindermFS16/src/orxonox/LevelManager.cc	(revision 11191)
@@ -99,4 +99,5 @@
     void LevelManager::setConfigValues()
     {
+
         SetConfigValue(defaultLevelName_, "missionOne.oxw")
             .description("Sets the pre selection of the level in the main menu.");
@@ -105,7 +106,7 @@
         SetConfigValue(campaignMissions_,  std::vector<std::string>())
             .description("The list of missions in the campaign");
-        //SetConfigValue(test_,  std::vector<int>())
-         //   .description("The list of missions and their statuses");
-            
+        //std::vector<int> v (allLevelStatus_.size(),0);
+        //SetConfigValue(allLevelWon_, v)
+        //    .description("The list of all won missions");
     }
 
@@ -185,4 +186,5 @@
     void LevelManager::activateNextLevel()
     {
+
         if (this->levels_.size() > 0)
         {
@@ -358,5 +360,5 @@
                 allLevelStatus_[i].activated=1;
                 std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
-                for(unsigned int j=i+1;j<allLevelStatus_.size();j++)
+                for(unsigned int j=0;j<allLevelStatus_.size();j++)
                 {
                     allLevelStatus_[j].activated=nextLevels[j];
@@ -366,49 +368,66 @@
     }
 
-    //updates the won variable of the corresponding LevelStatus in allLevelStatus_
+
     void LevelManager::setLevelStatus(const std::string& LevelWon)
     {
-        ModifyConfigValue(lastWonMission_, set, LevelWon);  
-    }
-
-
-    //build up allLevelStatus
+        
+            
+        ModifyConfigValue(lastWonMission_, set, LevelWon);
+
+        std::vector<int> v (allLevelStatus_.size(),0);
+        for(unsigned int i = 0;i<allLevelStatus_.size();i++)
+        {
+            if(allLevelStatus_[i].won)
+                v[i] =1;
+        }
+
+        SetConfigValue(allLevelWon_, v)
+            .description("The list of all won missions");
+
+            for (unsigned int i = 0; i < allLevelWon_.size(); ++i)
+            {
+                ModifyConfigValue(allLevelWon_[i], set, v[i]);
+            }
+
+    }
+
+
+    //build up allLevelStatus_
     //has to be done once per game (not per level)
-    //all connections between the levels are saved in here
+    //all connections between the levels are saved in the allLevelStatus_
+    //also the won variable of the LevelStatus is set to the corresponding allLevelWon_ value
     void LevelManager::buildallLevelStatus()
     {
-        LevelStatus* level = new LevelStatus(this->getContext());
-
-        /*LevelStatus level;
-        allLevelStatus_.assign (campaignMissions_.size(),level);
+        LevelStatus* level=new LevelStatus(this->getContext());
+        allLevelStatus_.assign (campaignMissions_.size(),*level);
         allLevelStatus_[0].activated=1;
-        //allLevelStatus_[0].won=true;
-
-
-        allLevelStatus_[0].nextLevels.push_back(1);
-        allLevelStatus_[0].nextLevels.push_back(1);
-        allLevelStatus_[0].nextLevels.push_back(0);
-        allLevelStatus_[0].nextLevels.push_back(0);
-        allLevelStatus_[0].nextLevels.push_back(0);
-        allLevelStatus_[0].nextLevels.push_back(0);
-        allLevelStatus_[0].nextLevels.push_back(0);
-
-        allLevelStatus_[1].nextLevels.push_back(1);
-        allLevelStatus_[1].nextLevels.push_back(2);
-        allLevelStatus_[1].nextLevels.push_back(1);
-        allLevelStatus_[1].nextLevels.push_back(0);
-        allLevelStatus_[1].nextLevels.push_back(0);
-        allLevelStatus_[1].nextLevels.push_back(0);
-        allLevelStatus_[1].nextLevels.push_back(0);
-
-        allLevelStatus_[2].nextLevels.push_back(2);
-        allLevelStatus_[2].nextLevels.push_back(1);
-        allLevelStatus_[2].nextLevels.push_back(0);
-        allLevelStatus_[2].nextLevels.push_back(0);
-        allLevelStatus_[2].nextLevels.push_back(1);
-        allLevelStatus_[2].nextLevels.push_back(0);
-        allLevelStatus_[2].nextLevels.push_back(0);*/
-
-
+
+
+        std::vector<int> v={1,1,1,0,0,0,0,0,0};
+        allLevelStatus_[0].nextLevels=v;
+
+        v={1,1,2,1,0,0,0,0,0};
+        allLevelStatus_[1].nextLevels=v;
+
+        v={1,2,1,0,1,0,0,0,0};
+        allLevelStatus_[2].nextLevels=v;
+
+        v={1,1,2,1,0,1,1,0,0};
+        allLevelStatus_[3].nextLevels=v;
+
+        v={1,2,1,0,1,0,0,1,1};
+        allLevelStatus_[4].nextLevels=v;
+
+        v={1,1,2,1,0,1,2,0,0};
+        allLevelStatus_[5].nextLevels=v;
+
+        v={1,1,2,1,0,2,1,0,0};
+        allLevelStatus_[6].nextLevels=v;
+
+        v={1,2,1,0,1,0,0,1,2};
+        allLevelStatus_[7].nextLevels=v;
+
+        v={1,2,1,0,1,0,0,2,1};
+        allLevelStatus_[8].nextLevels=v;
 
     }
