Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7094


Ignore:
Timestamp:
Jun 2, 2010, 11:16:20 PM (14 years ago)
Author:
dafrick
Message:

(Hopefully) fix in pickups.

Location:
code/branches/presentation3/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/pickup/PickupCollection.cc

    r6901 r7094  
    123123        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    124124        {
    125             (*it).get()->setCarrier(this->getCarrier()->getTarget(*it));
     125            (*it).get()->setCarrier(this->getCarrier()->getTarget(*it), true);
    126126        }
    127127    }
  • code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc

    r6996 r7094  
    213213        Sets the input PickupCarrier as the carrier of the pickup.
    214214    */
    215     inline bool Pickupable::setCarrier(PickupCarrier* carrier)
     215    inline bool Pickupable::setCarrier(PickupCarrier* carrier, bool tell)
    216216    {
    217217        if(this->carrier_ == carrier)
     
    222222        this->carrier_ = carrier;
    223223        this->changedCarrier();
     224        if(tell && carrier != NULL)
     225            this->carrier_->pickups_.insert(this);
    224226        return true;
    225227    }
  • code/branches/presentation3/src/orxonox/interfaces/Pickupable.h

    r6996 r7094  
    115115            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
    116116            bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
    117             bool setCarrier(PickupCarrier* carrier); //!< Sets the carrier of the pickup.
     117            bool setCarrier(PickupCarrier* carrier, bool tell = false); //!< Sets the carrier of the pickup.
    118118           
    119119        protected:
Note: See TracChangeset for help on using the changeset viewer.