Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6755


Ignore:
Timestamp:
Apr 19, 2010, 4:12:23 PM (15 years ago)
Author:
dafrick
Message:

Fixed Segfault upon dropping of InvisiblePickup, while it was being used.

Location:
code/trunk/src/modules/pickup/items
Files:
2 edited

Legend:

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

    r6710 r6755  
    113113        if (this->isUsed())
    114114        {
    115             this->startPickupTimer(this->getDuration());
     115            if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() > 0.0f)
     116            {
     117                this->getTimer()->unpauseTimer();
     118            }
     119            else
     120            {
     121                this->startPickupTimer(this->getDuration());
     122            }
    116123            this->setInvisible(true);
    117124        }
     
    119126        {
    120127            this->setInvisible(false);
    121             this->destroy();
     128       
     129            if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
     130            {
     131                this->destroy();
     132            }
     133            else
     134            {
     135                this->getTimer()->pauseTimer();
     136            }
    122137        }
    123138       
  • code/trunk/src/modules/pickup/items/SpeedPickup.cc

    r6728 r6755  
    161161                if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
    162162                {
    163                     //TODO: Potentially dangerous, not only for this pickup. Think long and hard about this!!!
    164163                    this->destroy();
    165164                }
Note: See TracChangeset for help on using the changeset viewer.