Index: code/trunk/src/modules/objects/Planet.cc
===================================================================
--- code/trunk/src/modules/objects/Planet.cc	(revision 10622)
+++ code/trunk/src/modules/objects/Planet.cc	(revision 10624)
@@ -85,8 +85,4 @@
 
         SUPER(Planet, tick, dt);
-    }
-
-    void Planet::init()
-    {
     }
 
Index: code/trunk/src/modules/objects/Planet.h
===================================================================
--- code/trunk/src/modules/objects/Planet.h	(revision 10622)
+++ code/trunk/src/modules/objects/Planet.h	(revision 10624)
@@ -52,5 +52,4 @@
             virtual ~Planet();
 
-            void init();
             virtual void tick(float dt);
 
Index: code/trunk/src/modules/objects/Script.cc
===================================================================
--- code/trunk/src/modules/objects/Script.cc	(revision 10622)
+++ code/trunk/src/modules/objects/Script.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "core/XMLPort.h"
 #include "network/Host.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 
 #include "PlayerManager.h"
@@ -198,5 +198,5 @@
                 for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)
                 {
-                    callStaticNetworkFunction(Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
+                    callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
                     if(this->times_ != Script::INF) // Decrement the number of remaining executions.
                     {
@@ -210,5 +210,5 @@
             else
             {
-                callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
+                callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
                 if(this->times_ != Script::INF) // Decrement the number of remaining executions.
                     this->remainingExecutions_--;
@@ -248,5 +248,5 @@
         if(GameMode::isServer() && this->isOnLoad())
         {
-            callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
+            callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
         }
     }
Index: code/trunk/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/trunk/src/modules/objects/SpaceBoundaries.cc	(revision 10622)
+++ code/trunk/src/modules/objects/SpaceBoundaries.cc	(revision 10624)
@@ -210,5 +210,5 @@
         for( std::list<WeakPtr<Pawn> >::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++ )
         {
-            Pawn* currentPawn = current->get();
+            Pawn* currentPawn = *current;
             if( currentPawn && currentPawn->getNode() ) 
             {
Index: code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc	(revision 10624)
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom(Class(CollisionShape));
+    RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom<CollisionShape>();
 
     /**
Index: code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc	(revision 10624)
@@ -58,11 +58,4 @@
     }
 
-    BoxCollisionShape::~BoxCollisionShape()
-    {
-        // TODO: Move to CollisionShape?
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void BoxCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 10624)
@@ -58,5 +58,4 @@
         public:
             BoxCollisionShape(Context* context);
-            virtual ~BoxCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc	(revision 10624)
@@ -54,10 +54,4 @@
     }
 
-    ConeCollisionShape::~ConeCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     /**
     @brief
Index: code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 10624)
@@ -56,5 +56,4 @@
         public:
             ConeCollisionShape(Context* context);
-            virtual ~ConeCollisionShape();
 
         private:
Index: code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc	(revision 10624)
@@ -54,10 +54,4 @@
     }
 
-    CylinderCollisionShape::~CylinderCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     /**
     @brief
Index: code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h	(revision 10624)
@@ -53,5 +53,4 @@
         public:
             CylinderCollisionShape(Context* context);
-            virtual ~CylinderCollisionShape();
 
         private:
Index: code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc	(revision 10624)
@@ -59,10 +59,4 @@
     }
 
-    PlaneCollisionShape::~PlaneCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void PlaneCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 10624)
@@ -58,5 +58,4 @@
         public:
             PlaneCollisionShape(Context* context);
-            virtual ~PlaneCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc	(revision 10624)
@@ -58,10 +58,4 @@
     }
 
-    SphereCollisionShape::~SphereCollisionShape()
-    {
-        if (this->isInitialized())
-            delete this->collisionShape_;
-    }
-
     void SphereCollisionShape::registerVariables()
     {
Index: code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 10622)
+++ code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 10624)
@@ -56,5 +56,4 @@
         public:
             SphereCollisionShape(Context* context);
-            virtual ~SphereCollisionShape();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 10624)
@@ -93,5 +93,5 @@
         DistanceTrigger::triggered(bIsTriggered);
 
-        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype().get());
+        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype());
         if (gametype)
         {
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 10624)
@@ -100,13 +100,12 @@
 
         // Check for objects that were in range but no longer are. Iterate through all objects, that are in range.
-        for(std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator it = this->range_.begin(); it != this->range_.end(); )
+        for(std::set<WeakPtr<WorldEntity> >::iterator it = this->range_.begin(); it != this->range_.end(); )
         {
-            WorldEntity* entity = it->second->get();
-            WorldEntity* key = it->first;
-            it++; // Incrementing the iterator in advance, since we don't need the current anymore and we potentially are going to delete the current element thus invalidating the iterator.
+            WorldEntity* entity = *it;
+
             // If the entity no longer exists.
             if(entity == NULL)
             {
-                this->removeFromRange(key);
+                this->range_.erase(it++);
                 continue;
             }
@@ -116,7 +115,5 @@
             if (distanceVec.length() > this->distance_)
             {
-                // If for some reason the entity could not be removed.
-                if(!this->removeFromRange(key))
-                    continue;
+                this->range_.erase(it++);
 
                 // If no queue has been created, yet.
@@ -129,4 +126,8 @@
                 state->originator = entity;
                 queue->push(state);
+            }
+            else
+            {
+                ++it;
             }
         }
@@ -260,32 +261,6 @@
     bool DistanceMultiTrigger::addToRange(WorldEntity* entity)
     {
-        WeakPtr<WorldEntity>* weakptr = new WeakPtr<WorldEntity>(entity);
-        std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, weakptr));
-
-        if(!pair.second)
-        {
-            delete weakptr;
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-    @brief
-        Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
-    @param entity
-        A pointer ot the entity.
-    @return
-        Returns true if successful.
-    */
-    bool DistanceMultiTrigger::removeFromRange(WorldEntity* entity)
-    {
-        WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second;
-        bool erased = this->range_.erase(entity) > 0;
-        if(erased)
-            delete weakptr;
-        return erased;
-    }
-
+        std::pair<std::set<WeakPtr<WorldEntity> >::iterator, bool> pair = this->range_.insert(entity);
+        return pair.second;
+    }
 }
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 10624)
@@ -140,5 +140,4 @@
 
             bool addToRange(WorldEntity* entity); // Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
-            bool removeFromRange(WorldEntity* entity); // Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
 
         private:
@@ -154,5 +153,5 @@
             ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
 
-            std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
+            std::set<WeakPtr<WorldEntity> > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
 
     };
Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 10624)
@@ -147,7 +147,7 @@
     {
         // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done.
-        if(this->cache_.get() != NULL)
-        {
-            if((this->cache_.get()->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
+        if(this->cache_ != NULL)
+        {
+            if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
                 return true;
             else
@@ -213,5 +213,5 @@
                 
                 // Add the entity to the cache.
-                this->cache_ = WeakPtr<WorldEntity>(entity);
+                this->cache_ = entity;
 
                 return true;
Index: code/trunk/src/modules/objects/triggers/Trigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/Trigger.cc	(revision 10622)
+++ code/trunk/src/modules/objects/triggers/Trigger.cc	(revision 10624)
@@ -38,5 +38,5 @@
 #include "core/GameMode.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "Scene.h"
