Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 14, 2010, 12:55:59 PM (15 years ago)
Author:
dafrick
Message:

Some more documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r7208 r7541  
    5757    {
    5858        RegisterObject(InvisiblePickup);
    59         //! Defines who is allowed to pick up the pickup.
    6059        this->initialize();
    6160    }
     
    8685    {
    8786        this->duration_ = 0.0f;
     87        // Defines who is allowed to pick up the pickup.
    8888        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
    8989    }
     
    9999
    100100        this->initializeIdentifier();
     101        this->setDurationType(Pickup::durationTypeOnce_s); // The duration type is always once.
    101102    }
    102103
     
    109110        SUPER(InvisiblePickup, changedUsed);
    110111
    111         //! If the pickup is not picked up nothing must be done.
     112        // If the pickup is not picked up nothing must be done.
    112113        if(!this->isPickedUp())
    113114            return;
     
    115116        if (this->isUsed())
    116117        {
    117             if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)
     118            if(this->isContinuous()
    118119            {
    119                 this->durationTimer_.unpauseTimer();
    120             }
    121             else
    122             {
    123                 this->durationTimer_.setTimer(this->getDuration(), false, createExecutor(createFunctor(&InvisiblePickup::pickupTimerCallback, this)));
     120                if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)
     121                {
     122                    this->durationTimer_.unpauseTimer();
     123                }
     124                else
     125                {
     126                    this->durationTimer_.setTimer(this->getDuration(), false, createExecutor(createFunctor(&InvisiblePickup::pickupTimerCallback, this)));
     127                }
    124128            }
    125129
Note: See TracChangeset for help on using the changeset viewer.