Index: code/branches/tutorial/src/orxonox/objects/controllers/DroneController.cc
===================================================================
--- code/branches/tutorial/src/orxonox/objects/controllers/DroneController.cc	(revision 2774)
+++ code/branches/tutorial/src/orxonox/objects/controllers/DroneController.cc	(revision 2775)
@@ -32,5 +32,4 @@
 #include "util/Math.h"
 
-
 namespace orxonox
 {
@@ -40,10 +39,10 @@
         // - make sure to register the object in the factory
         // - do any kind of initialisation
-        
-        
-        
+
+
+
         // this checks that our creator really is a drone
         // and saves the pointer to the drone for the controlling commands
-        assert(dynamic_cast<Drone*>(creator)!=0);
+        assert(dynamic_cast<Drone*>(creator) != 0);
         this->setControllableEntity(dynamic_cast<Drone*>(creator));
     }
@@ -57,10 +56,10 @@
         // Place your code here:
         // - steering commands
-        Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
+        Drone* myDrone = static_cast<Drone*>(this->getControllableEntity());
         // you can use the following commands for steering
         // - moveFrontBack, moveRightLeft, moveUpDown
         // - rotatePitch, rotateYaw, rotateRoll
         // - apply the to myDrone (e.g. myDrone->rotateYaw(..) )
-        
+
     }
 }
Index: code/branches/tutorial/src/orxonox/objects/worldentities/Drone.cc
===================================================================
--- code/branches/tutorial/src/orxonox/objects/worldentities/Drone.cc	(revision 2774)
+++ code/branches/tutorial/src/orxonox/objects/worldentities/Drone.cc	(revision 2775)
@@ -37,5 +37,4 @@
     // PLACE YOUR CODE HERE
     // create the factory for the drone
-    CreateFactory(Drone);
 
     Drone::Drone(BaseObject* creator) : ControllableEntity(creator)
@@ -45,5 +44,5 @@
         // - register the drone class to the core
         // - create a new controller and pass our this pointer to it as creator
-        
+
         this->localLinearAcceleration_.setValue(0, 0, 0);
         this->localAngularAcceleration_.setValue(0, 0, 0);
@@ -52,13 +51,13 @@
         this->rotationThrust_ = 10;
         this->steering_ = Vector3::ZERO;
-        
+
         this->setCollisionType(WorldEntity::Dynamic);
-        
-        myController_ = new DroneController(static_cast<BaseObject*>(this));
+
+        this->myController_ = new DroneController(this);
     }
 
     Drone::~Drone()
     {
-        if( this->myController_ )
+        if (this->isInitialized() && this->myController_)
             delete this->myController_;
     }
@@ -79,20 +78,20 @@
         // PLACE YOUR CODE HERE
         // make sure the tick function of the base class gets called here
-        
+
         this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
         this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
         if (this->localLinearAcceleration_.z() > 0)
-          this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
         else
-          this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
         this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
         this->localLinearAcceleration_.setValue(0, 0, 0);
-    
+
         this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
         this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
         this->localAngularAcceleration_.setValue(0, 0, 0);
     }
-    
-    
+
+
     void Drone::moveFrontBack(const Vector2& value)
     {
@@ -127,4 +126,3 @@
         this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
     }
-    
 }
Index: code/branches/tutorial/src/orxonox/objects/worldentities/Drone.h
===================================================================
--- code/branches/tutorial/src/orxonox/objects/worldentities/Drone.h	(revision 2774)
+++ code/branches/tutorial/src/orxonox/objects/worldentities/Drone.h	(revision 2775)
@@ -45,5 +45,5 @@
             virtual void tick(float dt);
 
-            
+
             virtual void moveFrontBack(const Vector2& value);
             virtual void moveRightLeft(const Vector2& value);
@@ -53,6 +53,6 @@
             virtual void rotatePitch(const Vector2& value);
             virtual void rotateRoll(const Vector2& value);
-            
-            
+
+
             inline void moveFrontBack(float value)
             { this->moveFrontBack(Vector2(value, 0)); }
@@ -61,5 +61,5 @@
             inline void moveUpDown(float value)
             { this->moveUpDown(Vector2(value, 0)); }
-            
+
             inline void rotateYaw(float value)
             { this->rotateYaw(Vector2(value, 0)); }
@@ -68,8 +68,8 @@
             inline void rotateRoll(float value)
             { this->rotateRoll(Vector2(value, 0)); }
-            
+
         private:
-            DroneController *myController_;
-            
+            DroneController* myController_;
+
             Vector3 steering_;
             btVector3 localLinearAcceleration_;
