Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2011, 12:14:57 AM (13 years ago)
Author:
dafrick
Message:

Fixing problems with beaconMask being NULL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/modules/objects/triggers/DistanceTrigger.cc

    r8667 r8675  
    5757        The creator of this trigger.
    5858    */
    59     DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator), beaconMask_(NULL)
     59    DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)
    6060    {
    6161        RegisterObject(DistanceTrigger);
     
    6464        this->targetMask_.exclude(Class(BaseObject));
    6565        this->targetName_ = "";
     66        this->beaconMask_.exclude(Class(BaseObject));
     67        this->beaconMask_.include(Class(DistanceTriggerBeacon));
    6668    }
    6769
     
    7274    DistanceTrigger::~DistanceTrigger()
    7375    {
    74         // Delete the beacon mask if it exists.
    75         if(this->beaconMask_ != NULL)
    76             delete this->beaconMask_;
     76
    7777    }
    7878
     
    159159        // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
    160160        if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
    161             targetMask = *this->beaconMask_;
     161            targetMask = this->beaconMask_;
    162162
    163163        // Iterate through all objects that are targets of the DistanceTrigger.
     
    231231    {
    232232        this->beaconMode_ = mode;
    233         if(this->beaconMode_ == distanceTriggerBeaconMode::identify && this->beaconMask_ == NULL)
    234         {
    235             this->beaconMask_ = new ClassTreeMask();
    236             this->beaconMask_->exclude(Class(BaseObject));
    237             this->beaconMask_->include(Class(DistanceTriggerBeacon));
    238         }
    239233    }
    240234
Note: See TracChangeset for help on using the changeset viewer.