Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 6, 2010, 7:44:04 PM (15 years ago)
Author:
dafrick
Message:

Some more documenting. Completed HealthPickup.

Location:
code/branches/pickup3/src/orxonox/interfaces
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h

    r6475 r6477  
    7676            @brief Can be called to drop a Pickupable.
    7777            @param pickup A pointer to the Pickupable.
     78            @param drop If the Pickupable should just be removed from the PickupCarrier without further action, this can be set to false. true is default.
    7879            @return Returns true if the Pickupable has been dropped, false if not.
    7980            */
    80             bool drop(Pickupable* pickup)
     81            bool drop(Pickupable* pickup, bool drop = true)
    8182                {
    8283                   bool dropped = this->pickups_.erase(pickup) == 1;
    83                    if(dropped)
     84                   if(dropped && drop)
    8485                   {
    8586                       pickup->dropped();
  • code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc

    r6475 r6477  
    6363    Pickupable::~Pickupable()
    6464    {
    65        
     65        if(this->isUsed())
     66            this->setUsed(false);
     67       
     68        if(this->isPickedUp())
     69        {
     70            this->getCarrier()->drop(this, false);
     71            this->setCarrier(NULL);
     72        }
    6673    }
    6774   
Note: See TracChangeset for help on using the changeset viewer.