Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7545 for code/trunk


Ignore:
Timestamp:
Oct 15, 2010, 8:35:20 AM (14 years ago)
Author:
dafrick
Message:

Improvements in InvisiblePickup.

Location:
code/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/tools/Timer.h

    r7401 r7545  
    133133            inline void unpauseTimer()
    134134                { this->bActive_ = true; }
    135             /// Returns true if the Timer is active (neither stoped nor paused).
     135            /// Returns true if the Timer is active (neither stopped nor paused).
    136136            inline bool isActive() const
    137137                { return this->bActive_; }
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r7544 r7545  
    9999
    100100        this->initializeIdentifier();
    101         this->setDurationType(Pickup::durationTypeOnce_s); // The duration type is always once.
    102101    }
    103102
     
    135134            this->setInvisible(false);
    136135
    137             if(this->isContinuous() || !this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration())
     136            if((!this->isContinuous() && this->isImmediate()) || (!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration()))
    138137            {
    139138                this->Pickupable::destroy();
    140139            }
    141             else
     140            else if(this->durationTimer_.isActive())
    142141            {
    143142                this->durationTimer_.pauseTimer();
  • code/trunk/src/modules/pickup/items/InvisiblePickup.h

    r7544 r7545  
    5454        - The <b>duration</b> Specifies how long (in seconds) the invisibility lasts.
    5555
     56        An examle of a XML implementation of a InvisiblePickup would be:
     57        @code
     58        <HealthPickup
     59            activationType = "immediate"
     60            durationType = "continuous"
     61            duration = 30.0
     62        />
     63        @endcode
     64
    5665    @author
    5766        Benedict Simlinger
Note: See TracChangeset for help on using the changeset viewer.