Index: code/branches/campaignHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10924)
+++ code/branches/campaignHS15/data/levels/AITest.oxw	(revision 10925)
@@ -92,5 +92,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" />
 
@@ -153,9 +153,9 @@
       </templates>
     </SpaceShip> 
- 
+  -->
    
 <!-- HERE ENDS DEMO FOR THE ACTIONPOINTS -->
 <!-- HERE STARTS DEMO FOR FIGHTING -->
-    <!-- 
+    
 
     <SpaceShip position="-4000, 1500, -1000" lookat="0,0,0" team=0 name="d1sd1">
@@ -202,5 +202,5 @@
       </templates>
       <controller>
-        <DivisionController team=1 formationMode="WALL">
+        <DivisionController team=1 formationMode="DIAMOND">
 
         </DivisionController>
@@ -234,5 +234,5 @@
       </controller>
     </SpaceShip> 
- -->
+
 <!-- HERE ENDS DEMO FOR FIGHTING -->
 <!-- HERE STARTS DEMO FOR FORMATIONS -->
Index: code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10924)
+++ code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc	(revision 10925)
@@ -110,4 +110,7 @@
         }
 
+        if (!this || !this->getControllableEntity())
+            return;
+
         if (this->ticks_ == 1)
         {
@@ -143,8 +146,5 @@
             this->lookAtTarget(dt);
         }
-        if (this->bShooting_)
-        {
-            this->doFire();
-        }
+        
 
         if (!this || !this->getControllableEntity())
@@ -159,38 +159,36 @@
         if (timeout_ <= 0)
             this->bFiredRocket_ = false;
-        if (!this || !this->getControllableEntity())
-            return;
+        
 
         if (!this || !this->getControllableEntity())
             return;
         if (this->timeout_ > 0 && this->bFiredRocket_)
-            {
-                this->timeout_ -= dt;
-            }
-            if (this->bStartedDodging_)
-            {
-                this->timeDodged_ += dt;
-            }
-            maneuverCounter_ += dt;
+        {
+            this->timeout_ -= dt;
+        }
+        if (this->bStartedDodging_)
+        {
+            this->timeDodged_ += dt;
+        }
+        maneuverCounter_ += dt;
+
         if (!this || !this->getControllableEntity())
             return;
         //maneuver every 0.25 sec -> 
         int step =  4;
-        if (this->hasTarget() && ActionpointController::sTicks_ % 100 == step * (this->actionpointControllerId_))
-        {
-            
-        }
         if (ActionpointController::sTicks_ % 100 == step * this->actionpointControllerId_ + 1)
         {
+            //orxout (internal_error) << "Team " << this->getControllableEntity()->getTeam() << (this->hasTarget() ? ", got " : ", don't have") << " target" << endl;
             this->action();
         }
-        if (!this || !this->getControllableEntity())
-            return;
-
-        
-        if (this->hasTarget() &&  ActionpointController::sTicks_ % ActionpointController::nextActionpointControllerId_ == (this->actionpointControllerId_))
+
+
+        if (!this || !this->getControllableEntity())
+            return;
+
+        if (this->hasTarget() &&  ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_))
         {
             if (maneuverCounter_ > 6.0f)
-                maneuverCounter_ = 0;
+                this->maneuverCounter_ = 0;
             if (this->bStartedDodging_ &&  this->timeDodged_ > 4.0f)
             {
@@ -199,12 +197,20 @@
             }
             if (!this || !this->getControllableEntity())
-            return;
+                return;
             this->maneuver();
             if (!this || !this->getControllableEntity())
-            return;
+                return;
             this->bShooting_ = this->canFire();
-        }
-        if (!this || !this->getControllableEntity())
-            return;
+
+            if (!this || !this->getControllableEntity())
+                return;
+
+            if (this->bShooting_)
+            {
+                this->doFire();
+            }
+            this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
+            this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
+        }
         
 
@@ -227,6 +233,5 @@
             return;
 
-        this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp;
-        this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth();
+
         if (!this || !this->getControllableEntity())
             return;
@@ -514,4 +519,7 @@
         }
         this->setAction (p.action);
+        if (!this || !this->getControllableEntity())
+            return;
+
         switch (this->action_)
         {
@@ -654,4 +662,7 @@
     void ActionpointController::moveBackToTop()
     {
+        if (!this || !this->getControllableEntity())
+            return;
+
         Point temp = loopActionpoints_.back();
         loopActionpoints_.pop_back();
Index: code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10924)
+++ code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc	(revision 10925)
@@ -211,4 +211,6 @@
                                                            hardcoded_projectile_speed, this->target_->getWorldPosition(), 
                                                            this->target_->getVelocity());
+        if (!this->target_ || !this->getControllableEntity())
+            return false;
         //Vector3.isNaN() is what I used on my machine and it worked...
         if (!(std::isnan(newPositionOfTarget.x) || std::isnan(newPositionOfTarget.y) || std::isnan(newPositionOfTarget.z)))
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10924)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10925)
@@ -95,4 +95,7 @@
         {
             ActionpointController* newDivisionLeader = findNewDivisionLeader();
+            if (!this || !this->getControllableEntity())
+                return;
+
             this->myDivisionLeader_ = newDivisionLeader;
             //spread copyOrientation called equally among the division
@@ -128,4 +131,7 @@
             else if (!this->myDivisionLeader_->bKeepFormation_)
             {
+                if (!this || !this->getControllableEntity())
+                    return;
+
                 if (!this->hasTarget())
                 {
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10924)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10925)
@@ -120,4 +120,7 @@
         {
             ActionpointController* newLeader = (findNewLeader());
+            if (!this || !this->getControllableEntity())
+                return;
+
             this->myLeader_ = newLeader;
             if (this->myLeader_)
@@ -147,4 +150,7 @@
             else if (!this->myLeader_->bKeepFormation_)
             {
+                if (!this || !this->getControllableEntity())
+                    return;
+
                 if (!this->hasTarget())
                 {
@@ -175,4 +181,6 @@
     Vector3 WingmanController::getFormationPosition ()
     {
+
+
         this->setFormationMode( this->myLeader_->getFormationMode() );
         Vector3* targetRelativePosition;
