Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 10624)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 11071)
@@ -106,5 +106,5 @@
             this->setForPlayer(true);
 
-        if (targetId == NULL)
+        if (targetId == nullptr)
         {
             orxout(internal_error, context::triggers) << "\"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << endl;
@@ -147,5 +147,5 @@
     {
         // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done.
-        if(this->cache_ != NULL)
+        if(this->cache_ != nullptr)
         {
             if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
@@ -158,5 +158,5 @@
         ClassTreeMask targetMask = this->targetMask_;
         // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
-        if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
+        if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
             targetMask = this->beaconMask_;
 
@@ -167,5 +167,5 @@
 
             // If the DistanceTrigger is in identify-mode and the DistanceTriggerBeacon attached to the object has the wrong name we ignore it.
-            if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
+            if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
             {
                 if(entity->getName() != this->targetName_)
@@ -177,12 +177,12 @@
 
             // If the DistanceTrigger is in exclude mode and the DistanceTriggerBeacon attached to the object has the right name, we ignore it.
-            if(this->beaconMode_ == distanceTriggerBeaconMode::exclude)
+            if(this->beaconMode_ == DistanceTriggerBeaconMode::exclude)
             {
 
-                const std::set<WorldEntity*> attached = entity->getAttachedObjects();
+                const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
                 bool found = false;
-                for(std::set<WorldEntity*>::const_iterator it = attached.begin(); it != attached.end(); it++)
+                for(WorldEntity* attachedObject : attachedObjects)
                 {
-                    if((*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(*it)->getName() == this->targetName_)
+                    if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
                     {
                         found = true;
@@ -202,12 +202,12 @@
                 {
                     // Change the entity to the parent of the DistanceTriggerBeacon (if in identify-mode), which is the entity to which the beacon is attached.
-                    if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
+                    if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
                         entity = entity->getParent();
 
                     Pawn* pawn = orxonox_cast<Pawn*>(entity);
-                    if(pawn != NULL)
+                    if(pawn != nullptr)
                         this->setTriggeringPawn(pawn);
                     else
-                        orxout(internal_warning, context::triggers) << "Pawn was NULL." << endl;
+                        orxout(internal_warning, context::triggers) << "Pawn was nullptr." << endl;
                 }
                 
@@ -228,5 +228,5 @@
         The mode as an enum.
     */
-    void DistanceTrigger::setBeaconModeDirect(distanceTriggerBeaconMode::Value mode)
+    void DistanceTrigger::setBeaconModeDirect(DistanceTriggerBeaconMode mode)
     {
         this->beaconMode_ = mode;
@@ -243,9 +243,9 @@
         switch(this->getBeaconModeDirect())
         {
-            case distanceTriggerBeaconMode::off :
+            case DistanceTriggerBeaconMode::off :
                 return DistanceTrigger::beaconModeOff_s;
-            case distanceTriggerBeaconMode::identify:
+            case DistanceTriggerBeaconMode::identify:
                 return DistanceTrigger::beaconModeIdentify_s;
-            case distanceTriggerBeaconMode::exclude:
+            case DistanceTriggerBeaconMode::exclude:
                 return DistanceTrigger::beaconModeExlcude_s;
             default :
@@ -264,9 +264,9 @@
     {
         if(mode == DistanceTrigger::beaconModeOff_s)
-            this->setBeaconModeDirect(distanceTriggerBeaconMode::off);
+            this->setBeaconModeDirect(DistanceTriggerBeaconMode::off);
         else if(mode == DistanceTrigger::beaconModeIdentify_s)
-            this->setBeaconModeDirect(distanceTriggerBeaconMode::identify);
+            this->setBeaconModeDirect(DistanceTriggerBeaconMode::identify);
         else if(mode == DistanceTrigger::beaconModeExlcude_s)
-            this->setBeaconModeDirect(distanceTriggerBeaconMode::exclude);
+            this->setBeaconModeDirect(DistanceTriggerBeaconMode::exclude);
         else
             orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceTrigger." << endl;
@@ -282,5 +282,5 @@
         Returns true if it is triggered ,false if not.
     */
-    bool DistanceTrigger::isTriggered(TriggerMode::Value mode)
+    bool DistanceTrigger::isTriggered(TriggerMode mode)
     {
         if (Trigger::isTriggered(mode))
