[Orxonox-commit 3187] r7880 - code/trunk/src/modules/overlays/hud

landauf at orxonox.net landauf at orxonox.net
Sun Feb 13 21:52:42 CET 2011


Author: landauf
Date: 2011-02-13 21:52:42 +0100 (Sun, 13 Feb 2011)
New Revision: 7880

Modified:
   code/trunk/src/modules/overlays/hud/HUDRadar.cc
   code/trunk/src/modules/overlays/hud/HUDRadar.h
Log:
radar doesn't abort if owner is missing
radar works with all ControllableEntities not just Pawns

Modified: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc	2011-02-13 20:35:47 UTC (rev 7879)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc	2011-02-13 20:52:42 UTC (rev 7880)
@@ -37,8 +37,7 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
 #include "tools/TextureGenerator.h"
-#include "worldentities/WorldEntity.h"
-#include "worldentities/pawns/Pawn.h"
+#include "worldentities/ControllableEntity.h"
 #include "Scene.h"
 #include "Radar.h"
 
@@ -143,10 +142,7 @@
     {
         // Make sure the owner of the radar was defined
         if( !this->owner_ )
-        {
-            CCOUT(0) << "No owner defined" << std::endl;
-            assert(0);
-        }
+            return;
 
         this->marker_->hide();      // in case that no object is in focus
         // get the focus object
@@ -189,10 +185,10 @@
 
     void HUDRadar::changedOwner()
     {
-    SUPER(HUDRadar, changedOwner);
+        SUPER(HUDRadar, changedOwner);
 
-    this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
-    assert(this->radarObjects_.size()==0);
-    this->gatherObjects();
+        this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
+        assert(this->radarObjects_.size() == 0);
+        this->gatherObjects();
+    }
 }
-}

Modified: code/trunk/src/modules/overlays/hud/HUDRadar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.h	2011-02-13 20:35:47 UTC (rev 7879)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.h	2011-02-13 20:52:42 UTC (rev 7880)
@@ -83,7 +83,7 @@
 
         float sensitivity_;
 
-        Pawn* owner_;
+        ControllableEntity* owner_;
     };
 }
 




More information about the Orxonox-commit mailing list