Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2010, 9:33:33 PM (15 years ago)
Author:
dafrick
Message:

Fixed a bug in pickups that caused the clone method of Pickup.h not to be called via SUPER.

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

Legend:

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

    r7007 r7008  
    4848    /*static*/ const std::string Pickup::durationTypeOnce_s = "once";
    4949    /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
     50
     51    CreateUnloadableFactory(Pickup);
    5052
    5153    Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
     
    146148    void Pickup::setActivationType(const std::string& type)
    147149    {
    148         if(Pickup::activationTypeImmediate_s.compare(type))
     150        if(Pickup::activationTypeImmediate_s.compare(type) == 0)
    149151        {
    150152            this->activationType_ = pickupActivationType::immediate;
    151153        }
    152         else if(Pickup::activationTypeOnUse_s.compare(type))
     154        else if(Pickup::activationTypeOnUse_s.compare(type) == 0)
    153155        {
    154156            this->activationType_ = pickupActivationType::onUse;
  • code/branches/presentation3/src/modules/pickup/Pickup.h

    r6728 r7008  
    7777    {
    7878
    79         protected:
     79        public:
    8080            Pickup(BaseObject* creator); //!< Constructor.
    81 
    82         public:
    8381            virtual ~Pickup(); //!< Destructor.
    8482
  • code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc

    r6709 r7008  
    189189    {
    190190        SUPER(HealthPickup, changedUsed);
    191        
     191
    192192        //! If the pickup is not picked up nothing must be done.
    193193        if(!this->isPickedUp())
     
    290290        if(item == NULL)
    291291            item = new HealthPickup(this);
    292        
     292
    293293        SUPER(HealthPickup, clone, item);
    294        
     294
    295295        HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
    296296        pickup->setHealth(this->getHealth());
Note: See TracChangeset for help on using the changeset viewer.