[Orxonox-commit 2211] r6927 - code/branches/presentation3/src/orxonox

scheusso at orxonox.net scheusso at orxonox.net
Thu May 20 10:28:10 CEST 2010


Author: scheusso
Date: 2010-05-20 10:28:10 +0200 (Thu, 20 May 2010)
New Revision: 6927

Modified:
   code/branches/presentation3/src/orxonox/LevelManager.cc
Log:
fix in levelmanager: if a template was assigned to the Level the gametype was set twice to the level which resulted in the level being twice in the list of active levels in the levelmanager and only once removed (when the level was destroyed)


Modified: code/branches/presentation3/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/presentation3/src/orxonox/LevelManager.cc	2010-05-20 08:23:22 UTC (rev 6926)
+++ code/branches/presentation3/src/orxonox/LevelManager.cc	2010-05-20 08:28:10 UTC (rev 6927)
@@ -69,7 +69,8 @@
 
     void LevelManager::requestActivity(Level* level)
     {
-        COUT(0) << "pushing level into level list: " << level << endl;
+        if( std::find(this->levels_s.begin(), this->levels_s.end(), level)!=this->levels_s.end() )
+            return; // level is already in list
         this->levels_s.push_back(level);
         if (this->levels_s.size() == 1)
             this->activateNextLevel();
@@ -77,7 +78,6 @@
 
     void LevelManager::releaseActivity(Level* level)
     {
-        COUT(0) << "poping level from level list: " << level << endl;
         if (this->levels_s.size() > 0)
         {
             if (this->levels_s.front() == level)




More information about the Orxonox-commit mailing list