Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6901 for code


Ignore:
Timestamp:
May 15, 2010, 8:47:07 AM (15 years ago)
Author:
dafrick
Message:

Fixed PickupCollection. It works now the way it was intended and no restructuring of the pickupsystem was necessary.

Location:
code/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/pickup.oxw

    r6731 r6901  
    114114    <!-- Pickup Collection pickups -->
    115115   
    116     <!--PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     116    <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
    117117        <pickup>
    118118            <PickupCollection template=triplehealthspeedinvisibilitypickup />
    119119        </pickup>
    120     </PickupSpawner-->
     120    </PickupSpawner>
    121121   
    122122  </Scene>
  • code/trunk/src/modules/pickup/PickupCollection.cc

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

    r6731 r6901  
    102102        Returns true if the given PickupCarrier is a target.
    103103    */
    104     bool Pickupable::isTarget(const PickupCarrier* carrier) const
     104    bool Pickupable::isTarget(PickupCarrier* carrier) const
    105105    {
    106106        if(carrier == NULL)
  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r6731 r6901  
    9898            bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
    9999           
    100             virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
     100            virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
    101101            bool isTarget(const Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    102102            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
Note: See TracChangeset for help on using the changeset viewer.