Index: code/branches/campaignHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10874)
+++ code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10875)
@@ -62,5 +62,5 @@
 <!-- HERE STARTS DEMO FOR THE ACTIONPOINTS. 
 P.S. Never set protectMe in the first actionpoint: if human didn't spawn, that actionpoint will be skipped -->
-       <!-- 
+       
     <Model mesh="cube.mesh" scale=8 position="0,0,0" />
 
@@ -124,5 +124,5 @@
     </SpaceShip> 
  
-    -->
+   
 <!-- HERE ENDS DEMO FOR THE ACTIONPOINTS -->
 <!-- HERE STARTS DEMO FOR FIGHTING -->
@@ -210,5 +210,5 @@
 <!-- HERE ENDS DEMO FOR FIGHTING -->
 <!-- HERE STARTS DEMO FOR FORMATIONS -->
-    
+    <!-- 
     <Model mesh="cube.mesh" scale=8 position="   0,2000,    0" />
     <Model mesh="cube.mesh" scale=8 position="   0,2000,-2000" />
@@ -259,5 +259,5 @@
       </controller>
     </SpaceShip> 
-   
+    -->
 <!-- HERE ENDS DEMO FOR FORMATIONS -->
     
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10875)
@@ -30,6 +30,6 @@
 
 #include "core/XMLPort.h"
-
-#include "controllers/NewHumanController.h"
+#include <algorithm>
+
 
 namespace orxonox
@@ -295,5 +295,5 @@
                     for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
                     {
-                        if (orxonox_cast<ControllableEntity*>(*itP) && ((*itP)->getController()) && orxonox_cast <NewHumanController*> ((*itP)->getController()))
+                        if (orxonox_cast<ControllableEntity*>(*itP) && ((*itP)->getController()) && ((*itP)->getController()->getIdentifier()->getName() == "NewHumanController"))
                         {
                             this->setProtect (static_cast<ControllableEntity*>(*itP));
Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10875)
@@ -38,4 +38,5 @@
 #include "controllers/NewHumanController.h"
 #include "controllers/DroneController.h"
+#include "util/Math.h"
 
 namespace orxonox
Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10875)
@@ -34,12 +34,9 @@
 #include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
-#include "util/Math.h"
 
 #include "tools/Timer.h"
 #include "tools/interfaces/Tickable.h"
 #include <limits>
-#include <algorithm>
 #include "worldentities/Actionpoint.h"
-#include "worldentities/pawns/SpaceShip.h"
 
 namespace orxonox
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10875)
@@ -28,5 +28,5 @@
 #include "controllers/FightingController.h"
 #include "core/XMLPort.h"
-#include <limits>								//for finding closest target
+#include "util/Math.h"
 
 
Index: code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc	(revision 10875)
@@ -29,4 +29,5 @@
 #include "core/XMLPort.h"
 #include "worldentities/pawns/SpaceShip.h"
+#include "util/Math.h"
 
 namespace orxonox
@@ -128,11 +129,13 @@
     void FlyingController::copyOrientation( const Quaternion& orient, float dt )
     {
-        //roll angle difference in radian
-        float diff=orient.getRoll(false).valueRadians() -
+
+        double diff=orient.getRoll(false).valueRadians() -
                         ( this->getControllableEntity() ->getOrientation() .getRoll( false ).valueRadians() );
-        while( diff>math::twoPi )diff-=math::twoPi;
+        while( diff>math::twoPi)diff-=math::twoPi;
         while( diff<-math::twoPi )diff+=math::twoPi;
-        this->getControllableEntity() ->rotateRoll( diff*0.2f*ROTATEFACTOR * dt );
+
+        this->getControllableEntity() ->rotateRoll(diff * ROTATEFACTOR * dt);
     }
+    //change log: increased precision, increased rotation speed
     void FlyingController::copyTargetOrientation( float dt )
     {
Index: code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h	(revision 10875)
@@ -36,5 +36,5 @@
 {   
     const float SPEED = 0.9f/0.02f;
-    const float ROTATEFACTOR = 1.0f/0.02f;
+    const float ROTATEFACTOR = 0.6f/0.02f;
     namespace FormationMode
     {
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10875)
@@ -78,6 +78,38 @@
         if (!this->isActive())
             return;
-      
-        
+
+    //this doesn't fight in formation flight, thus we can afford executing following code in tick: when nobody fights, tick is anyway stable.
+        if (this->myDivisionLeader_ && this->myDivisionLeader_->getAction() != Action::FIGHT && this->myDivisionLeader_->getAction() !=
+            Action::FIGHTALL && this->myDivisionLeader_->getAction() != Action::ATTACK)
+        {
+            ControllableEntity* myEntity = this->getControllableEntity();
+            Vector3 myPosition = myEntity->getWorldPosition();
+            if (!this->myDivisionLeader_)
+            {
+                return;
+            }
+            ControllableEntity* leaderEntity = this->myDivisionLeader_->getControllableEntity();
+            Quaternion orient = leaderEntity->getWorldOrientation();
+            Vector3 leaderPosition = leaderEntity->getWorldPosition();
+
+            Vector3 targetRelativePosition = getFormationPosition();
+            if (!this->myDivisionLeader_)
+            {
+                return;
+            }
+            Vector3 targetAbsolutePosition = 
+                (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
+                 + (orient* (targetRelativePosition)));
+       
+            this->setAction (Action::FLY, targetAbsolutePosition, orient);
+            if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
+            {
+                this->boostControl();
+            }
+            else
+            {
+               this->getControllableEntity()->boost(false);
+            }
+        }    
         SUPER(SectionController, tick, dt);
     }
@@ -143,32 +175,5 @@
                 default:
                 {
-                    ControllableEntity* myEntity = this->getControllableEntity();
-                    Vector3 myPosition = myEntity->getWorldPosition();
-                    if (!this->myDivisionLeader_)
-                    {
-                        return;
-                    }
-                    ControllableEntity* leaderEntity = this->myDivisionLeader_->getControllableEntity();
-                    Quaternion orient = leaderEntity->getWorldOrientation();
-                    Vector3 leaderPosition = leaderEntity->getWorldPosition();
-
-                    Vector3 targetRelativePosition = getFormationPosition();
-                    if (!this->myDivisionLeader_)
-                    {
-                        return;
-                    }
-                    Vector3 targetAbsolutePosition = 
-                        (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
-                         + (orient* (targetRelativePosition)));
-               
-                    this->setAction (Action::FLY, targetAbsolutePosition, orient);
-                    if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
-                    {
-                        this->boostControl();
-                    }
-                    else
-                    {
-                       this->getControllableEntity()->boost(false);
-                    }
+                    //formation flight is executed in tick
                 }
             }
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10874)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10875)
@@ -68,5 +68,36 @@
         if (!this->isActive())
             return;
-        
+        if (this->myLeader_ && this->myLeader_->getAction() != Action::FIGHT && this->myLeader_->getAction() !=
+            Action::FIGHTALL && this->myLeader_->getAction() != Action::ATTACK)
+        {
+            ControllableEntity* myEntity = this->getControllableEntity();
+            Vector3 myPosition = myEntity->getWorldPosition();
+            if (!this->myLeader_)
+            {
+                return;
+            }
+            ControllableEntity* leaderEntity = this->myLeader_->getControllableEntity();
+            Quaternion orient = leaderEntity->getWorldOrientation();
+            Vector3 leaderPosition = leaderEntity->getWorldPosition();
+
+            Vector3 targetRelativePosition = getFormationPosition();
+            if (!this->myLeader_)
+            {
+                return;
+            }
+            Vector3 targetAbsolutePosition = 
+                (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
+                 + (orient* (targetRelativePosition)));
+       
+            this->setAction (Action::FLY, targetAbsolutePosition, orient);
+            if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
+            {
+                this->boostControl();
+            }
+            else
+            {
+               this->getControllableEntity()->boost(false);
+            }
+        }   
         
         SUPER(WingmanController, tick, dt);
@@ -123,33 +154,5 @@
                 default:
                 {
-                    ControllableEntity* myEntity = this->getControllableEntity();
-                    Vector3 myPosition = myEntity->getWorldPosition();
-                    if (!this->myLeader_)
-                    {
-                        return;
-                    }
                     
-                    ControllableEntity* leaderEntity = this->myLeader_->getControllableEntity();
-                    Quaternion orient = leaderEntity->getWorldOrientation();
-                    Vector3 leaderPosition = leaderEntity->getWorldPosition();
-
-                    Vector3 targetRelativePosition = getFormationPosition();
-                    if (!this->myLeader_)
-                    {
-                        return;
-                    }
-                    Vector3 targetAbsolutePosition = 
-                        (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
-                         + (orient* (targetRelativePosition)));
-               
-                    this->setAction (Action::FLY, targetAbsolutePosition, orient);
-                    if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
-                    {
-                        this->boostControl();
-                    }
-                    else
-                    {
-                       this->getControllableEntity()->boost(false);
-                    }
                 }
             }
