Index: code/branches/campaignHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10879)
+++ code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10880)
@@ -221,5 +221,5 @@
       </templates>
       <controller>
-        <DivisionController team=0 formationMode="Finger4" spread=100>
+        <DivisionController team=0 formationMode="diamond" spread=100>
           <actionpoints>
             <Actionpoint position="   0,2000,    0" action="FLY" loopStart=true/>
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10880)
@@ -360,8 +360,7 @@
     void ActionpointController::stayNearProtect()
     {
-        Vector3* targetRelativePosition;
-        targetRelativePosition = new Vector3 (0, 300, 300);  
+        Vector3 targetRelativePosition(0, 300, 300);  
         Vector3 targetAbsolutePosition = ((this->getProtect()->getWorldPosition()) + 
-            (this->getProtect()->getWorldOrientation()* (*targetRelativePosition)));
+            (this->getProtect()->getWorldOrientation()* (targetRelativePosition)));
         this->setTargetPosition(targetAbsolutePosition);
         this->setTargetOrientation(this->getProtect()->getWorldOrientation());
@@ -567,6 +566,5 @@
         if (this->action_ != Action::FIGHT && this->action_ != Action::FIGHTALL)
         {
-            if ( (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_) 
-                || !this->target_ )
+            if (!this->target_ || (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_))
             {
                 Pawn* newTarget = this->closestTarget();
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10880)
@@ -126,5 +126,5 @@
         Vector3 diffUnit = diffVector/diffLength;
 
-        bool bTargetIsLookingAtThis = CommonController::isLooking ( this->target_, getControllableEntity(), math::pi/10.0f );
+        bool bTargetIsLookingAtThis = CommonController::isLooking ( this->target_, getControllableEntity(), math::pi/20.0f );
         
         //too far? well, come closer then
@@ -191,6 +191,8 @@
         );
         Vector3 projection = randVector->dotProduct( diffUnit )* diffUnit;
-        *randVector -= projection;
-        target += *randVector;
+        Vector3 randV = *randVector;
+        delete randVector;
+        randV -= projection;
+        target += randV;
         this->setTargetPosition( thisPosition + target );
     }
Index: code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc	(revision 10880)
@@ -38,4 +38,5 @@
     {
         this->rotationProgress_ = 0;
+        this->tickCounter_ = 0;
         this->spread_ = 200;
         this->tolerance_ = 80;
@@ -94,16 +95,18 @@
     {
         ControllableEntity* entity = this->getControllableEntity();
-        Vector2 coord = get2DViewCoordinates
-            ( entity->getPosition() , 
-            entity->getOrientation()  * WorldEntity::FRONT, 
-            entity->getOrientation()  * WorldEntity::UP, 
-            target );
+        this->tickCounter_ += this->tickCounter_ < 100000 ? 1 : -this->tickCounter_ ;
 
         float distance = ( target - this->getControllableEntity() ->getPosition() ).length();
-        float rotateX = -clamp( coord.x * 10, -1.0f, 1.0f );
-        float rotateY = clamp( coord.y * 10, -1.0f, 1.0f );
+
 
         if ( distance > this->tolerance_ )
         {
+            Vector2 coord = get2DViewCoordinates
+                ( entity->getPosition() , 
+                entity->getOrientation()  * WorldEntity::FRONT, 
+                entity->getOrientation()  * WorldEntity::UP, 
+                target );
+            float rotateX = -clamp( coord.x * 10, -1.0f, 1.0f );
+            float rotateY = clamp( coord.y * 10, -1.0f, 1.0f );
             this->getControllableEntity() ->rotateYaw( ROTATEFACTOR * rotateX * dt );
             this->getControllableEntity() ->rotatePitch( ROTATEFACTOR * rotateY * dt );
@@ -112,10 +115,6 @@
             if (distance > this->tolerance_*1.5f || (rotateX > -0.01 && rotateX < 0.01 && rotateY > -0.01 && rotateY < 0.01))
                 this->getControllableEntity() ->moveFrontBack( SPEED * dt );
-          
-            // if ( bHasTargetOrientation_ && (rotateX > -0.005 && rotateX < 0.005 && rotateY > -0.005 && rotateY < 0.005) )
-            // {
+            if (this->tickCounter_ % 10 == 0 )
                 copyTargetOrientation( dt );
-            // }
-            
         }
         else
@@ -125,4 +124,5 @@
         }
     }
+    
     void FlyingController::moveToTargetPosition(float dt)
     {
@@ -136,5 +136,5 @@
        
         Quaternion myOrient = this->getControllableEntity()->getOrientation();
-        this->rotationProgress_ += dt/50.0f;
+        this->rotationProgress_ += 5*dt;
 
         if (this->rotationProgress_ > 1)
@@ -144,5 +144,5 @@
         else
         {
-            Quaternion delta = Quaternion::Slerp(this->rotationProgress_, myOrient, orient, true);
+            Quaternion delta = Quaternion::Slerp(rotationProgress_, myOrient, orient, true);
       
             Matrix3 orientMatrix, myMatrix;
@@ -153,9 +153,8 @@
             orientMatrix.ToEulerAnglesYXZ(yRad, pRad, rRad);
             myMatrix.ToEulerAnglesYXZ (yMy, pMy, rMy);
-            orxout (internal_error) << "dt = " << dt << endl;
-            this->getControllableEntity()->rotateRoll (50.0f*dt*(rRad.valueRadians() - rMy.valueRadians()));
+            this->getControllableEntity()->rotateRoll (50.0f * dt*(rRad.valueRadians() - rMy.valueRadians()));
             //this->getControllableEntity()->setOrientation(delta);
         }
-        //this shit works. How? 
+        
         
     }
Index: code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h	(revision 10880)
@@ -83,4 +83,5 @@
           
             float rotationProgress_;
+            int tickCounter_;
             bool bHasTargetPosition_;
             Vector3 targetPosition_;
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10880)
@@ -276,5 +276,7 @@
             }
         }
-        return *targetRelativePosition;
+        Vector3 result = *targetRelativePosition;
+        delete targetRelativePosition;
+        return result;
     }
 
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10879)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10880)
@@ -149,4 +149,5 @@
        
             this->setAction (Action::FLY, targetAbsolutePosition, orient);
+
             if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
             {
@@ -217,6 +218,7 @@
             }
         }
-        
-        return *targetRelativePosition;
+        Vector3 result = *targetRelativePosition;
+        delete targetRelativePosition;
+        return result;
     }
     //----POST: closest leader that is ready to take a new wingman is returned----
