Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8193 for code/trunk/src


Ignore:
Timestamp:
Apr 6, 2011, 11:12:38 AM (14 years ago)
Author:
dafrick
Message:

Resolving bug in MultiTrigger.

Location:
code/trunk/src/modules/objects/triggers
Files:
2 edited

Legend:

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

    r7601 r8193  
    116116        }
    117117
    118         // Check if the object is active (this is NOT MultiTrigger::isActive()!)
     118        // Check if the object is active (this is NOT MultiTrigger::isActive()!), it is whether the MultiTrigger actually does anything, ever.
    119119        if (!this->BaseObject::isActive())
    120120            return;
     
    205205                            {
    206206                                // If the MultiTrigger has not exceeded its remaining activations.
    207                                 if(this->remainingActivations_ > 0)
     207                                if(this->hasRemainingActivations())
    208208                                {
    209209                                    this->active_.insert(state->originator);
     
    218218                            {
    219219                                // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations.
    220                                 if(!this->getStayActive() || this->remainingActivations_ > 0)
     220                                if(!this->getStayActive() || this->hasRemainingActivations())
    221221                                    this->active_.erase(state->originator);
    222222                                else
  • code/trunk/src/modules/objects/triggers/TriggerBase.h

    r7652 r8193  
    185185            inline void setActivations(int activations)
    186186                { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; }
     187               
     188            inline bool hasRemainingActivations(void)
     189                { return this->remainingActivations_ == INF_s || this->remainingActivations_  > 0; }
    187190
    188191            /**
Note: See TracChangeset for help on using the changeset viewer.