Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2010, 4:08:15 PM (15 years ago)
Author:
ebeier
Message:

added some speedpickup templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc

    r6681 r6694  
    137137        if(this->isUsed())
    138138        {
    139             this->startPickupTimer(this->getDuration());
    140 
    141139            Engine* engine = this->carrierToEngineHelper();
    142140            if(engine == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    143141                this->destroy();
     142
     143            this->startPickupTimer(this->getDuration());
    144144            engine->setSpeedAdd(this->getSpeedAdd());
    145145            engine->setSpeedMultiply(this->getSpeedMultiply());
     
    208208        {
    209209            COUT(1) << "Invalid duration in SpeedPickup." << std::endl;
    210             this->duration_ = 0;
     210            this->duration_ = 0.0f;
    211211        }
    212212    }
     
    227227        {
    228228            COUT(1) << "Invalid speedAdd in SpeedPickup." << std::endl;
    229             this->speedAdd_ = 0.0;
     229            this->speedAdd_ = 0.0f;
    230230        }
    231231    }
     
    246246        {
    247247            COUT(1) << "Invalid speedMultiply in SpeedPickup." << std::endl;
    248             this->speedMultiply_ = 1.0;
     248            this->speedMultiply_ = 1.0f;
    249249        }
    250250    }
    251251
    252252    void SpeedPickup::PickupTimerCallBack(void) {
    253         /* Reset values */
     253            Engine* engine = this->carrierToEngineHelper();
     254            if(engine == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     255                this->destroy();
     256
     257            engine->setSpeedAdd(0.0f);
     258            engine->setSpeedMultiply(1.0f);
    254259    }
    255260}
Note: See TracChangeset for help on using the changeset viewer.