Changeset 7541 for code/trunk/src/modules/pickup/items/InvisiblePickup.cc
- Timestamp:
- Oct 14, 2010, 12:55:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/items/InvisiblePickup.cc
r7208 r7541 57 57 { 58 58 RegisterObject(InvisiblePickup); 59 //! Defines who is allowed to pick up the pickup.60 59 this->initialize(); 61 60 } … … 86 85 { 87 86 this->duration_ = 0.0f; 87 // Defines who is allowed to pick up the pickup. 88 88 this->addTarget(ClassIdentifier<Pawn>::getIdentifier()); 89 89 } … … 99 99 100 100 this->initializeIdentifier(); 101 this->setDurationType(Pickup::durationTypeOnce_s); // The duration type is always once. 101 102 } 102 103 … … 109 110 SUPER(InvisiblePickup, changedUsed); 110 111 111 // !If the pickup is not picked up nothing must be done.112 // If the pickup is not picked up nothing must be done. 112 113 if(!this->isPickedUp()) 113 114 return; … … 115 116 if (this->isUsed()) 116 117 { 117 if( !this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)118 if(this->isContinuous() 118 119 { 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 } 124 128 } 125 129
Note: See TracChangeset
for help on using the changeset viewer.