Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10877)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10879)
@@ -71,4 +71,63 @@
             Action::FIGHTALL && this->myLeader_->getAction() != Action::ATTACK)
         {
+        }   
+        
+        SUPER(WingmanController, tick, dt);
+    }
+    
+    //----action for hard calculations----
+    void WingmanController::action()
+    {
+
+        //----If no leader, find one----
+        if (!this->myLeader_)
+        {
+            ActionpointController* newLeader = (findNewLeader());
+            this->myLeader_ = newLeader;
+            if (this->myLeader_)
+            {
+
+            }
+        }
+        //----If have leader, he will deal with logic----
+        else
+        {
+
+        }
+        if (!this->myLeader_)
+        {
+           ActionpointController::action();
+        }
+        else if (this->myLeader_)
+        {
+            switch (this->myLeader_->getAction())
+            {
+                case Action::FIGHT:
+                {
+                    if (!this->hasTarget())
+                    {
+                        this->setTarget(this->myLeader_->getTarget());
+                    }
+                    break;
+                }
+                case Action::FIGHTALL:
+                {
+                    if (!this->hasTarget())
+                    {
+                        this->setTarget(this->myLeader_->getTarget());
+                    }
+                    break;
+                }
+                case Action::ATTACK:
+                {
+                    if (!this->hasTarget())
+                    {
+                        this->setTarget(this->myLeader_->getTarget());
+                    }
+                    break;
+                }
+                default:
+                {
+                    
             ControllableEntity* myEntity = this->getControllableEntity();
             Vector3 myPosition = myEntity->getWorldPosition();
@@ -80,5 +139,4 @@
             Quaternion orient = leaderEntity->getWorldOrientation();
             Vector3 leaderPosition = leaderEntity->getWorldPosition();
-
             Vector3 targetRelativePosition = getFormationPosition();
             if (!this->myLeader_)
@@ -99,60 +157,4 @@
                this->getControllableEntity()->boost(false);
             }
-        }   
-        
-        SUPER(WingmanController, tick, dt);
-    }
-    
-    //----action for hard calculations----
-    void WingmanController::action()
-    {
-
-        //----If no leader, find one----
-        if (!this->myLeader_)
-        {
-            ActionpointController* newLeader = (findNewLeader());
-            this->myLeader_ = newLeader;
-           
-        }
-        //----If have leader, he will deal with logic----
-        else
-        {
-
-        }
-        if (!this->myLeader_)
-        {
-           ActionpointController::action();
-        }
-        else if (this->myLeader_)
-        {
-            switch (this->myLeader_->getAction())
-            {
-                case Action::FIGHT:
-                {
-                    if (!this->hasTarget())
-                    {
-                        this->setTarget(this->myLeader_->getTarget());
-                    }
-                    break;
-                }
-                case Action::FIGHTALL:
-                {
-                    if (!this->hasTarget())
-                    {
-                        this->setTarget(this->myLeader_->getTarget());
-                    }
-                    break;
-                }
-                case Action::ATTACK:
-                {
-                    if (!this->hasTarget())
-                    {
-                        this->setTarget(this->myLeader_->getTarget());
-                    }
-                    break;
-                }
-                default:
-                {
-                    
                 }
             }
@@ -179,15 +181,15 @@
                 case FormationMode::WALL:
                 {
-                    targetRelativePosition = new Vector3 (2*this->spread_, 0, 0);  
+                    targetRelativePosition = new Vector3 (2*this->spread_, 0, 0 - this->tolerance_);  
                     break;
                 }
                 case FormationMode::FINGER4: 
                 {
-                    targetRelativePosition = new Vector3 (2*this->spread_, 0, this->spread_);  
+                    targetRelativePosition = new Vector3 (2*this->spread_, 0, this->spread_ - this->tolerance_);  
                     break;
                 }
                 case FormationMode::DIAMOND: 
                 {
-                    targetRelativePosition = new Vector3 (2*this->spread_, 0, this->spread_);                  
+                    targetRelativePosition = new Vector3 (2*this->spread_, 0, this->spread_ - this->tolerance_);                  
                     break;
                 }
@@ -200,15 +202,15 @@
                 case FormationMode::WALL:
                 {
-                    targetRelativePosition = new Vector3 (-2*this->spread_, 0, 0);  
+                    targetRelativePosition = new Vector3 (-2*this->spread_, 0, 0 - this->tolerance_);  
                     break;
                 }
                 case FormationMode::FINGER4: 
                 {
-                    targetRelativePosition = new Vector3 (-2*this->spread_, 0, this->spread_);  
+                    targetRelativePosition = new Vector3 (-2*this->spread_, 0, this->spread_ - this->tolerance_);  
                     break;
                 }
                 case FormationMode::DIAMOND: 
                 {
-                    targetRelativePosition = new Vector3 (2*this->spread_, -this->spread_, 0);                  
+                    targetRelativePosition = new Vector3 (2*this->spread_, -this->spread_, 0 - this->tolerance_);                  
                     break;
                 }
