[Orxonox-commit 4122] r8793 - in code/branches/ai2: data/levels src/orxonox/controllers

jo at orxonox.net jo at orxonox.net
Thu Jul 28 17:24:32 CEST 2011


Author: jo
Date: 2011-07-28 17:24:32 +0200 (Thu, 28 Jul 2011)
New Revision: 8793

Modified:
   code/branches/ai2/data/levels/lastTeamStanding.oxw
   code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
   code/branches/ai2/src/orxonox/controllers/WaypointController.cc
Log:
Destructor update.

Modified: code/branches/ai2/data/levels/lastTeamStanding.oxw
===================================================================
--- code/branches/ai2/data/levels/lastTeamStanding.oxw	2011-07-27 19:21:29 UTC (rev 8792)
+++ code/branches/ai2/data/levels/lastTeamStanding.oxw	2011-07-28 15:24:32 UTC (rev 8793)
@@ -46,13 +46,8 @@
       </collisionShapes>
     </StaticEntity>
 
-    <PickupSpawner position="-160,65,10" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
+    <PickupSpawner position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
       <pickup>
-        <InvisiblePickup template=mediuminvisiblepickup />
-      </pickup>
-    </PickupSpawner>
-    <PickupSpawner position="-160,60,17" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
-      <pickup>
         <InvisiblePickup template=hugeinvisiblepickup />
       </pickup>
     </PickupSpawner>

Modified: code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai2/src/orxonox/controllers/ArtificialController.cc	2011-07-27 19:21:29 UTC (rev 8792)
+++ code/branches/ai2/src/orxonox/controllers/ArtificialController.cc	2011-07-28 15:24:32 UTC (rev 8793)
@@ -103,12 +103,7 @@
     {
         if (this->isInitialized())
         {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end());
-            for (size_t i = 0; i < this->waypoints_.size(); ++i)
-            {
-                if(this->waypoints_[i])
-                    this->waypoints_[i]->destroy();
-            }
-            //this->waypoints_.clear();
+            this->waypoints_.clear();
             this->removeFromFormation();
             this->weaponModes_.clear();
             for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it)

Modified: code/branches/ai2/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/branches/ai2/src/orxonox/controllers/WaypointController.cc	2011-07-27 19:21:29 UTC (rev 8792)
+++ code/branches/ai2/src/orxonox/controllers/WaypointController.cc	2011-07-28 15:24:32 UTC (rev 8793)
@@ -44,6 +44,11 @@
 
     WaypointController::~WaypointController()
     {
+        for (size_t i = 0; i < this->waypoints_.size(); ++i)
+        {
+            if(this->waypoints_[i])
+                this->waypoints_[i]->destroy();
+        }
     }
 
     void WaypointController::XMLPort(Element& xmlelement, XMLPort::Mode mode)




More information about the Orxonox-commit mailing list