Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7829


Ignore:
Timestamp:
Jan 13, 2011, 11:43:20 PM (14 years ago)
Author:
dafrick
Message:

Fixing small bug in MultiTrigger.

Location:
code/branches/tutoriallevel/src/modules/objects/triggers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel/src/modules/objects/triggers/MultiTrigger.cc

    r7601 r7829  
    198198                        if(bActive ^ this->isActive(state->originator))
    199199                        {
    200 
    201200                            bool bFire = true;
    202201
     
    205204                            {
    206205                                // If the MultiTrigger has not exceeded its remaining activations.
    207                                 if(this->remainingActivations_ > 0)
     206                                if(this->hasRemainingActivations())
    208207                                {
    209208                                    this->active_.insert(state->originator);
     
    218217                            {
    219218                                // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations.
    220                                 if(!this->getStayActive() || this->remainingActivations_ > 0)
     219                                if(!this->getStayActive() || this->hasRemainingActivations())
    221220                                    this->active_.erase(state->originator);
    222221                                else
  • code/branches/tutoriallevel/src/modules/objects/triggers/TriggerBase.h

    r7652 r7829  
    133133            inline int getActivations(void) const
    134134                { return this->remainingActivations_; }
     135            /**
     136            @brief Check whether the trigger has still at least one remaining activation.
     137            @return Returns true if the trigger has remaining activations (i.e. the number of remaining activations is not zero).
     138            */
     139            inline bool hasRemainingActivations(void) const
     140                { return this->remainingActivations_ > 0 || this->remainingActivations_ == INF_s; }
    135141
    136142            /**
Note: See TracChangeset for help on using the changeset viewer.