Index: code/trunk/src/orxonox/controllers/ActionpointController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ActionpointController.cc	(revision 11052)
+++ code/trunk/src/orxonox/controllers/ActionpointController.cc	(revision 11071)
@@ -339,5 +339,5 @@
             inLoop = this->bInLoop_;
 
-            Action::Value value;
+            Action value;
             
             if ( actionName == "FIGHT" )
@@ -371,8 +371,8 @@
             return this->actionpoints_[index];
         else
-            return 0;
+            return nullptr;
     }
     //XML method
-    Action::Value ActionpointController::getAction ()
+    Action ActionpointController::getAction ()
     {
         return this->action_;
@@ -401,10 +401,10 @@
     }
     //XML method
-    void ActionpointController::setAction (Action::Value action)
+    void ActionpointController::setAction (Action action)
     {
         this->action_ = action;
     }
     //set action and target/protect
-    void ActionpointController::setAction (Action::Value action, ControllableEntity* target)
+    void ActionpointController::setAction (Action action, ControllableEntity* target)
     {
         if (!this || !this->getControllableEntity())
@@ -423,5 +423,5 @@
     }
     //set action and target position
-    void ActionpointController::setAction (Action::Value action, const Vector3& target)
+    void ActionpointController::setAction (Action action, const Vector3& target)
     {
         if (!this || !this->getControllableEntity())
@@ -434,5 +434,5 @@
     }
     //set action and target position and orientation
-    void ActionpointController::setAction (Action::Value action, const Vector3& target,  const Quaternion& orient )
+    void ActionpointController::setAction (Action action, const Vector3& target,  const Quaternion& orient )
     {
         if (!this || !this->getControllableEntity())
@@ -476,5 +476,5 @@
                 return;
 
-            this->setTarget(0);
+            this->setTarget(nullptr);
             this->setTargetPosition(this->getControllableEntity()->getWorldPosition());
             this->action_ = Action::NONE;
@@ -506,11 +506,11 @@
                 if (targetName == "")
                     break;
-                for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
-                {
-                    if (!this || !this->getControllableEntity())
-                        return;
-                    if (CommonController::getName(*itP) == targetName)
+                for (Pawn* pawn : ObjectList<Pawn>())
+                {
+                    if (!this || !this->getControllableEntity())
+                        return;
+                    if (CommonController::getName(pawn) == targetName)
                     {
-                        this->setTarget (static_cast<ControllableEntity*>(*itP));
+                        this->setTarget (static_cast<ControllableEntity*>(pawn));
                     }
                 }
@@ -541,9 +541,9 @@
                 if (protectName == "reservedKeyword:human")
                 {
-                    for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+                    for (Pawn* pawn : ObjectList<Pawn>())
                     {
-                        if (orxonox_cast<ControllableEntity*>(*itP) && ((*itP)->getController()) && ((*itP)->getController()->getIdentifier()->getName() == "NewHumanController"))
+                        if (orxonox_cast<ControllableEntity*>(pawn) && (pawn->getController()) && (pawn->getController()->getIdentifier()->getName() == "NewHumanController"))
                         {
-                            this->setProtect (static_cast<ControllableEntity*>(*itP));
+                            this->setProtect (static_cast<ControllableEntity*>(pawn));
                         }
                     }
@@ -551,9 +551,9 @@
                 else
                 {
-                    for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+                    for (Pawn* pawn : ObjectList<Pawn>())
                     {
-                        if (CommonController::getName(*itP) == protectName)
+                        if (CommonController::getName(pawn) == protectName)
                         {
-                            this->setProtect (static_cast<ControllableEntity*>(*itP));
+                            this->setProtect (static_cast<ControllableEntity*>(pawn));
                         }
                     }                            
@@ -578,11 +578,11 @@
                 std::string targetName = p.name;
 
-                for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
-                {
-                    if (CommonController::getName(*itP) == targetName)
+                for (Pawn* pawn : ObjectList<Pawn>())
+                {
+                    if (CommonController::getName(pawn) == targetName)
                     {
                         if (!this || !this->getControllableEntity())
                             return;
-                        this->setTarget (static_cast<ControllableEntity*>(*itP));
+                        this->setTarget (static_cast<ControllableEntity*>(pawn));
                     }
                 }
@@ -702,20 +702,20 @@
     {
         if (!this || !this->getControllableEntity())
-            return 0;
-
-        Pawn* closestTarget = 0;
+            return nullptr;
+
+        Pawn* closestTarget = nullptr;
         float minDistance =  std::numeric_limits<float>::infinity();
         Gametype* gt = this->getGametype();
-        for (ObjectList<Pawn>::iterator itP = ObjectList<Pawn>::begin(); itP; ++itP)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             if (!this || !this->getControllableEntity())
-                return 0;
-            if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(*itP), gt) )
+                return nullptr;
+            if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), gt) )
                 continue;
 
-            float distance = CommonController::distance (*itP, this->getControllableEntity());
+            float distance = CommonController::distance (pawn, this->getControllableEntity());
             if (distance < minDistance)
             {
-                closestTarget = *itP;
+                closestTarget = pawn;
                 minDistance = distance;
             }
@@ -725,5 +725,5 @@
            return closestTarget;
         } 
-        return 0;  
+        return nullptr;
     }
     //push action FIGHT to the stack and set target to the closest enemy
