Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7544 for code/trunk/src


Ignore:
Timestamp:
Oct 15, 2010, 8:14:03 AM (14 years ago)
Author:
dafrick
Message:

Fixing bug I introduced.

Location:
code/trunk/src/modules/pickup/items
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r7541 r7544  
    116116        if (this->isUsed())
    117117        {
    118             if(this->isContinuous()
     118            if(this->isContinuous())
    119119            {
    120120                if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)
     
    135135            this->setInvisible(false);
    136136
    137             if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration())
     137            if(this->isContinuous() || !this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration())
    138138            {
    139139                this->Pickupable::destroy();
     
    213213    /**
    214214    @brief
    215         Sets the duration.
     215        Sets the time the InvisibilityPickup will last.
    216216    @param duration
    217         The duration
     217        The duration in seconds.
    218218    */
    219219    void InvisiblePickup::setDuration(float duration)
     
    230230    }
    231231
     232    /**
     233    @brief
     234        Helper method. Is called by the Timer as soon as it expires.
     235    */
    232236    void InvisiblePickup::pickupTimerCallback(void)
    233237    {
  • code/trunk/src/modules/pickup/items/InvisiblePickup.h

    r7541 r7544  
    6565            InvisiblePickup(BaseObject* creator); //!< Constructor.
    6666            virtual ~InvisiblePickup(); //!< Destructor.
     67           
    6768            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
    6869            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
     
    7576            inline bool getInvisibility(bool)
    7677                { return this->invisible_; }
    77             inline float getDuration()
     78            /**
     79            @brief Get the time the InvisibilityPickup lasts.
     80            @return Returns the time in seconds the InvisibiltyPickup lasts.
     81            */
     82            inline float getDuration(void)
    7883                { return this->duration_; }
    7984
    8085        protected:
     86            void initializeIdentifier(void);
     87
    8188            bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
    82             void setDuration(float duration);
    83             void initializeIdentifier(void);
    84             void pickupTimerCallback(void); //!< Function that gets called when the timer ends.
     89            void setDuration(float duration); //!< Sets the time the InvisibilityPickup will last.
     90
     91            void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires.
    8592
    8693        private:
Note: See TracChangeset for help on using the changeset viewer.