Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 13, 2011, 9:52:42 PM (14 years ago)
Author:
landauf
Message:

radar doesn't abort if owner is missing
radar works with all ControllableEntities not just Pawns

Location:
code/trunk/src/modules/overlays/hud
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r7401 r7880  
    3838#include "core/XMLPort.h"
    3939#include "tools/TextureGenerator.h"
    40 #include "worldentities/WorldEntity.h"
    41 #include "worldentities/pawns/Pawn.h"
     40#include "worldentities/ControllableEntity.h"
    4241#include "Scene.h"
    4342#include "Radar.h"
     
    144143        // Make sure the owner of the radar was defined
    145144        if( !this->owner_ )
    146         {
    147             CCOUT(0) << "No owner defined" << std::endl;
    148             assert(0);
    149         }
     145            return;
    150146
    151147        this->marker_->hide();      // in case that no object is in focus
     
    190186    void HUDRadar::changedOwner()
    191187    {
    192     SUPER(HUDRadar, changedOwner);
     188        SUPER(HUDRadar, changedOwner);
    193189
    194     this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
    195     assert(this->radarObjects_.size()==0);
    196     this->gatherObjects();
     190        this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
     191        assert(this->radarObjects_.size() == 0);
     192        this->gatherObjects();
     193    }
    197194}
    198 }
  • code/trunk/src/modules/overlays/hud/HUDRadar.h

    r7401 r7880  
    8484        float sensitivity_;
    8585
    86         Pawn* owner_;
     86        ControllableEntity* owner_;
    8787    };
    8888}
Note: See TracChangeset for help on using the changeset viewer.