[Orxonox-commit 5904] r10563 - code/branches/core7/src/orxonox

landauf at orxonox.net landauf at orxonox.net
Sat Aug 29 23:24:32 CEST 2015


Author: landauf
Date: 2015-08-29 23:24:32 +0200 (Sat, 29 Aug 2015)
New Revision: 10563

Modified:
   code/branches/core7/src/orxonox/Level.cc
Log:
level should be it's own level (the same pattern that is already used for Namespace, Scene, and Gametype)

Modified: code/branches/core7/src/orxonox/Level.cc
===================================================================
--- code/branches/core7/src/orxonox/Level.cc	2015-08-29 21:15:28 UTC (rev 10562)
+++ code/branches/core7/src/orxonox/Level.cc	2015-08-29 21:24:32 UTC (rev 10563)
@@ -48,6 +48,7 @@
     {
         RegisterObject(Level);
 
+        this->setLevel(StrongPtr<Level>(this, false));
 
         this->registerVariables();
         this->xmlfilename_ = this->getFilename();
@@ -120,6 +121,7 @@
             this->gametype_ = gametype;
 
         Gametype* rootgametype = orxonox_cast<Gametype*>(identifier->fabricate(this));
+        rootgametype->setLevel(NULL); // avoid circular references
         this->setGametype(rootgametype);
 
         for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
@@ -133,7 +135,6 @@
     void Level::addObject(BaseObject* object)
     {
         this->objects_.push_back(object);
-        object->setLevel(this);
     }
 
     BaseObject* Level::getObject(unsigned int index) const




More information about the Orxonox-commit mailing list