Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 11, 2010, 8:55:13 AM (14 years ago)
Author:
dafrick
Message:

Merged presentation3 branch into trunk.

Location:
code/trunk
Files:
10 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/pickup/items/CMakeLists.txt

    • Property svn:eol-style set to native
    r6710 r7163  
    33  InvisiblePickup.cc
    44  MetaPickup.cc
     5  DronePickup.cc
    56  SpeedPickup.cc
     7  ShieldPickup.cc
    68)
  • code/trunk/src/modules/pickup/items/HealthPickup.cc

    r6709 r7163  
    4545namespace orxonox
    4646{
    47    
     47
    4848    /*static*/ const std::string HealthPickup::healthTypeLimited_s = "limited";
    4949    /*static*/ const std::string HealthPickup::healthTypeTemporary_s = "temporary";
    5050    /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent";
    51    
     51
    5252    CreateFactory(HealthPickup);
    53    
     53
    5454    /**
    5555    @brief
     
    5959    {
    6060        RegisterObject(HealthPickup);
    61        
     61
    6262        this->initialize();
    6363    }
    64    
     64
    6565    /**
    6666    @brief
     
    6969    HealthPickup::~HealthPickup()
    7070    {
    71        
    72     }
    73    
    74     /**
    75     @brief 
     71
     72    }
     73
     74    /**
     75    @brief
    7676        Initializes the member variables.
    7777    */
    7878    void HealthPickup::initialize(void)
    79     {       
     79    {
    8080        this->health_ = 0;
    8181        this->healthRate_ = 0;
     
    8383        this->maxHealthSave_ = 0;
    8484        this->maxHealthOverwrite_ = 0;
    85        
     85
    8686        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
    8787    }
    88    
     88
    8989    /**
    9090    @brief
     
    9898        std::string val1 = stream.str();
    9999        this->pickupIdentifier_->addParameter(type1, val1);
    100        
     100
    101101        std::string val2 = this->getHealthType();
    102102        std::string type2 = "healthType";
    103103        this->pickupIdentifier_->addParameter(type2, val2);
    104        
     104
    105105        stream.clear();
    106106        stream << this->getHealthRate();
     
    109109        this->pickupIdentifier_->addParameter(type3, val3);
    110110    }
    111    
     111
    112112    /**
    113113    @brief
     
    117117    {
    118118        SUPER(HealthPickup, XMLPort, xmlelement, mode);
    119        
     119
    120120        XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode);
    121121        XMLPortParam(HealthPickup, "healthRate", setHealthRate, getHealthRate, xmlelement, mode);
    122122        XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode);
    123        
     123
    124124        if(!this->isContinuous())
    125125            this->healthRate_ = 0.0;
    126        
     126
    127127        this->initializeIdentifier();
    128128    }
    129    
     129
    130130    /**
    131131    @brief
     
    138138    {
    139139        SUPER(HealthPickup, tick, dt);
    140        
     140
    141141        if(this->isContinuous() && this->isUsed())
    142142        {
    143143            Pawn* pawn = this->carrierToPawnHelper();
    144144            if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    145                 this->destroy();
    146            
     145                this->Pickupable::destroy();
     146
    147147            //! Calculate the health that is added this tick.
    148148            float health = dt*this->getHealthRate();
     
    152152            float fullHealth = pawn->getHealth() + health;
    153153            this->setHealth(this->getHealth()-health);
    154                    
     154
    155155            switch(this->getHealthTypeDirect())
    156156            {
     
    173173                    COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
    174174            }
    175            
     175
    176176            //! If all health has been transfered.
    177177            if(this->getHealth() == 0)
     
    181181        }
    182182    }
    183    
     183
    184184    /**
    185185    @brief
     
    189189    {
    190190        SUPER(HealthPickup, changedUsed);
    191        
     191
    192192        //! If the pickup is not picked up nothing must be done.
    193         if(!this->isPickedUp())
     193        if(!this->isPickedUp()) //TODO: Needed?
    194194            return;
    195        
     195
    196196        //! If the pickup has transited to used.
    197197        if(this->isUsed())
     
    201201                Pawn* pawn = this->carrierToPawnHelper();
    202202                if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    203                     this->destroy();
    204                
     203                    this->Pickupable::destroy();
     204
    205205                float health = 0;
    206206                switch(this->getHealthTypeDirect())
     
    226226                        COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
    227227                }
    228                
     228
    229229                //! The pickup has been used up.
    230230                this->setUsed(false);
     
    237237                PickupCarrier* carrier = this->getCarrier();
    238238                Pawn* pawn = dynamic_cast<Pawn*>(carrier);
    239                
     239
    240240                if(pawn == NULL)
    241241                {
    242242                    COUT(1) << "Something went horribly wrong in Health Pickup. PickupCarrier is no Pawn." << std::endl;
    243                     this->destroy();
     243                    this->Pickupable::destroy();
    244244                    return;
    245245                }
    246                
     246
    247247                if(pawn->getMaxHealth() == this->maxHealthOverwrite_)
    248248                {
     
    252252                }
    253253            }
    254            
     254
    255255            //! If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused.
    256256            if(this->isOnce() || (this->isContinuous() && this->getHealth() == 0))
    257257            {
    258                 this->destroy();
    259             }
    260         }
    261     }
    262    
     258                this->Pickupable::destroy();
     259            }
     260        }
     261    }
     262
    263263    /**
    264264    @brief
     
    271271        PickupCarrier* carrier = this->getCarrier();
    272272        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
    273        
     273
    274274        if(pawn == NULL)
    275275        {
    276276            COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl;
    277277        }
    278        
     278
    279279        return pawn;
    280280    }
    281    
     281
    282282    /**
    283283    @brief
     
    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());
    297297        pickup->setHealthRate(this->getHealthRate());
    298298        pickup->setHealthTypeDirect(this->getHealthTypeDirect());
    299        
     299
    300300        pickup->initializeIdentifier();
    301301    }
    302    
     302
    303303    /**
    304304    @brief
     
    322322        }
    323323    }
    324    
     324
    325325    /**
    326326    @brief
     
    341341        }
    342342    }
    343    
     343
    344344    /**
    345345    @brief
     
    356356        else
    357357        {
    358             COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl; 
    359         }
    360     }
    361    
     358            COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl;
     359        }
     360    }
     361
    362362    /**
    363363    @brief
  • code/trunk/src/modules/pickup/items/HealthPickup.h

    r6709 r7163  
    4545
    4646namespace orxonox {
    47    
     47
    4848    //! Enum for the type of the HealthPickup
    4949    namespace pickupHealthType
     
    5656        };
    5757    }
    58    
     58
    5959    /**
    6060    @brief
     
    7171    {
    7272        public:
    73        
     73
    7474            HealthPickup(BaseObject* creator); //!< Constructor.
    7575            virtual ~HealthPickup(); //!< Destructor.
    76            
     76
    7777            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
    7878            virtual void tick(float dt); //!< Is called every tick.
    79            
     79
    8080            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    8181            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    82            
     82
    8383            /**
    8484            @brief Get the health that is transfered to the Pawn upon usage of this pickup.
     
    9393            inline float getHealthRate(void)
    9494                { return this->healthRate_; }
    95                
     95
    9696            /**
    9797            @brief Get the type of HealthPickup, this pickup is.
    98             @return Returns the health type as an enum. 
     98            @return Returns the health type as an enum.
    9999            */
    100100            inline pickupHealthType::Value getHealthTypeDirect(void)
    101101                { return this->healthType_; }
    102102            const std::string& getHealthType(void); //!< Get the health type of this pickup.
    103            
     103
    104104        protected:
    105105            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
     
    107107            void setHealth(float health); //!< Sets the health.
    108108            void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous.
    109            
     109
    110110            /**
    111111            @brief Set the health type of this pickup.
     
    115115                { this->healthType_ = type; }
    116116            void setHealthType(std::string type); //!< Set the type of the HealthPickup.
    117        
     117
    118118        private:
    119119            void initialize(void); //!< Initializes the member variables.
    120120            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    121            
     121
    122122            float health_; //!< The health that is transferred to the Pawn.
    123123            float healthRate_; //!< The rate at which the health is transferred.
     
    125125            float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well.
    126126            pickupHealthType::Value healthType_; //!< The type of the HealthPickup.
    127            
     127
    128128            //! Strings for the health types.
    129129            static const std::string healthTypeLimited_s;
    130130            static const std::string healthTypeTemporary_s;
    131131            static const std::string healthTypePermanent_s;
    132        
     132
    133133    };
    134134}
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    • Property svn:eol-style set to native
    r6755 r7163  
    3434#include "InvisiblePickup.h"
    3535
     36#include <sstream>
     37#include <OgreEntity.h>
     38#include <OgreAnimationState.h>
     39
     40#include "util/StringUtils.h"
    3641#include "core/CoreIncludes.h"
    3742#include "core/XMLPort.h"
    38 #include "util/StringUtils.h"
    3943
    4044#include "worldentities/pawns/Pawn.h"
    4145#include "pickup/PickupIdentifier.h"
    4246
    43 #include <sstream>
    44 
    4547namespace orxonox
    4648{
    4749
    4850    CreateFactory(InvisiblePickup);
    49    
     51
    5052    /**
    5153    @brief
     
    5658        RegisterObject(InvisiblePickup);
    5759        //! Defines who is allowed to pick up the pickup.
    58         this->initialize(); 
    59     }
    60    
     60        this->initialize();
     61    }
     62
    6163    /**
    6264    @brief
     
    6466    */
    6567    InvisiblePickup::~InvisiblePickup()
    66     {       
    67     }
    68    
    69    
     68    {
     69    }
     70
     71
    7072    void InvisiblePickup::initializeIdentifier(void)
    7173    {
     
    7678        this->pickupIdentifier_->addParameter(type1, val1);
    7779    }
    78    
     80
    7981    /**
    8082    @brief
     
    9395    void InvisiblePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
    9496    {
    95         SUPER(InvisiblePickup, XMLPort, xmlelement, mode);   
     97        SUPER(InvisiblePickup, XMLPort, xmlelement, mode);
    9698        XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
    97        
     99
    98100        this->initializeIdentifier();
    99101    }
    100    
     102
    101103    /**
    102104    @brief
     
    106108    {
    107109        SUPER(InvisiblePickup, changedUsed);
    108        
     110
    109111        //! If the pickup is not picked up nothing must be done.
    110112        if(!this->isPickedUp())
    111113            return;
    112        
     114
    113115        if (this->isUsed())
    114116        {
     
    121123                this->startPickupTimer(this->getDuration());
    122124            }
     125
    123126            this->setInvisible(true);
     127
    124128        }
    125129        else
    126130        {
    127131            this->setInvisible(false);
    128        
     132
    129133            if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
    130134            {
    131                 this->destroy();
     135                this->Pickupable::destroy();
    132136            }
    133137            else
     
    136140            }
    137141        }
    138        
    139     }
    140    
     142
     143    }
     144
    141145    /**
    142146    @brief
     
    149153        PickupCarrier* carrier = this->getCarrier();
    150154        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
    151        
     155
    152156        if(pawn == NULL)
    153157        {
     
    156160        return pawn;
    157161    }
    158    
     162
    159163    /**
    160164    @brief
     
    167171        if(item == NULL)
    168172            item = new InvisiblePickup(this);
    169        
     173
    170174        SUPER(InvisiblePickup, clone, item);
    171        
     175
    172176        InvisiblePickup* pickup = dynamic_cast<InvisiblePickup*>(item);
    173177        pickup->setDuration(this->getDuration());
    174178        pickup->initializeIdentifier();
    175179    }
    176    
     180
    177181    /**
    178182    @brief
     
    186190        if(pawn == NULL)
    187191            return false;
    188        
     192
    189193        pawn->setVisible(!invisibility);
     194        pawn->setRadarVisibility(!invisibility);
     195
     196// Test to change Material at runtime!
     197
     198//      Ogre::MaterialPtr mat = this->mesh_.getEntity()->getSubEntity(0)->getMaterial();
     199//      mat->setDiffuse(0.4, 0.3, 0.1, 0.1);
     200//      mat->setAmbient(0.3, 0.7, 0.8);
     201//      mat->setSpecular(0.5, 0.5, 0.5, 0.1);
     202//      Ogre::SceneBlendType sbt = Ogre::SBT_ADD;
     203//
     204//      mat->setSceneBlending(sbt);
     205
    190206        return true;
    191207    }
    192    
     208
    193209    /**
    194210    @brief
     
    209225        }
    210226    }
    211    
     227
    212228    void InvisiblePickup::pickupTimerCallback(void)
    213229    {
  • code/trunk/src/modules/pickup/items/InvisiblePickup.h

    • Property svn:eol-style set to native
    r6710 r7163  
    3838
    3939#include <string>
     40
    4041#include <worldentities/pawns/Pawn.h>
    4142#include "worldentities/StaticEntity.h"
    42 
    4343#include "pickup/Pickup.h"
    4444
    4545namespace orxonox {
    46        
     46
    4747    /**
    4848    @brief
     
    5757    {
    5858        public:
    59        
     59
    6060            InvisiblePickup(BaseObject* creator); //!< Constructor.
    6161            virtual ~InvisiblePickup(); //!< Destructor.
     
    6363            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    6464            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    65            
     65
    6666            /**
    6767            @brief Checks whether the Pawn is invisible.
     
    7272            inline float getDuration()
    7373                { return this->duration_; }
    74  
     74
    7575        protected:
    7676            bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
     
    7878            void initializeIdentifier(void);
    7979            virtual void pickupTimerCallback(void); //!< Function that gets called when the timer ends.
    80        
     80
    8181        private:
    8282            void initialize(void); //!< Initializes the member variables.
  • code/trunk/src/modules/pickup/items/MetaPickup.cc

    r6709 r7163  
    3434#include "core/CoreIncludes.h"
    3535#include "core/XMLPort.h"
     36#include "worldentities/pawns/Pawn.h"
    3637#include "interfaces/PickupCarrier.h"
    3738#include "pickup/PickupIdentifier.h"
     
    4041
    4142namespace orxonox {
    42  
     43
    4344    CreateFactory(MetaPickup);
    44    
     45
    4546    //! Setting the static variables to their values.
    4647    /*static*/ const std::string MetaPickup::metaTypeNone_s = "none";
    4748    /*static*/ const std::string MetaPickup::metaTypeUse_s = "use";
    4849    /*static*/ const std::string MetaPickup::metaTypeDrop_s = "drop";
    49    
     50    /*static*/ const std::string MetaPickup::metaTypeDestroy_s = "destroy";
     51    /*static*/ const std::string MetaPickup::metaTypeDestroyCarrier_s = "destroyCarrier";
     52
    5053    /**
    5154    @brief
     
    5558    {
    5659        RegisterObject(MetaPickup);
    57        
     60
    5861        this->initialize();
    5962    }
    60    
     63
    6164    /**
    6265    @brief
     
    6568    MetaPickup::~MetaPickup()
    6669    {
    67        
    68     }
    69    
     70
     71    }
     72
    7073    /**
    7174    @brief
     
    7578    {
    7679        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
    77        
     80
    7881        this->setActivationTypeDirect(pickupActivationType::immediate);
    7982        this->setDurationTypeDirect(pickupDurationType::once);
    8083        this->metaType_ = pickupMetaType::none;
    8184    }
    82    
     85
    8386    /**
    8487    @brief
     
    9194        this->pickupIdentifier_->addParameter(type, val);
    9295    }
    93    
     96
    9497    /**
    9598    @brief
     
    99102    {
    100103        SUPER(MetaPickup, XMLPort, xmlelement, mode);
    101        
     104
    102105        XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode);
    103        
     106
    104107        this->initializeIdentifier();
    105108    }
    106    
     109
    107110    /**
    108111    @brief
     
    113116    {
    114117        SUPER(MetaPickup, changedUsed);
    115        
     118
    116119        //! If the MetaPickup transited to used.
    117120        if(this->isUsed())
     
    120123            if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
    121124            {
     125                if(this->getMetaTypeDirect() == pickupMetaType::destroyCarrier)
     126                {
     127                    Pawn* pawn = orxonox_cast<Pawn*>(carrier);
     128                    pawn->kill();
     129                    return;
     130                }
    122131                std::set<Pickupable*> pickups = carrier->getPickups();
    123                 //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending o the meta type.
     132                //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending on the meta type.
    124133                for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
    125134                {
     
    136145                        if(pickup != NULL && pickup != this)
    137146                        {
    138                             carrier->drop(pickup);
     147                            pickup->drop();
     148                        }
     149                    }
     150                    if(this->getMetaTypeDirect() == pickupMetaType::destroy)
     151                    {
     152                        if(pickup != NULL && pickup != this)
     153                        {
     154                            pickup->Pickupable::destroy();
    139155                        }
    140156                    }
    141157                }
    142158            }
    143             this->destroy();
    144         }
    145     }
    146        
     159            this->Pickupable::destroy();
     160        }
     161    }
     162
    147163    /**
    148164    @brief
     
    155171        if(item == NULL)
    156172            item = new MetaPickup(this);
    157        
     173
    158174        SUPER(MetaPickup, clone, item);
    159        
     175
    160176        MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
    161177        pickup->setMetaTypeDirect(this->getMetaTypeDirect());
    162        
     178
    163179        pickup->initializeIdentifier();
    164180    }
    165    
     181
    166182    /**
    167183    @brief
     
    180196            case pickupMetaType::drop:
    181197                return MetaPickup::metaTypeDrop_s;
     198            case pickupMetaType::destroy:
     199                return MetaPickup::metaTypeDestroy_s;
     200            case pickupMetaType::destroyCarrier:
     201                return MetaPickup::metaTypeDestroyCarrier_s;
    182202            default:
    183203                return BLANKSTRING;
    184204        }
    185205    }
    186    
     206
    187207    /**
    188208    @brief
     
    205225            this->setMetaTypeDirect(pickupMetaType::drop);
    206226        }
    207     }
    208    
     227        else if(type == MetaPickup::metaTypeDestroy_s)
     228        {
     229            this->setMetaTypeDirect(pickupMetaType::destroy);
     230        }
     231        else if(type == MetaPickup::metaTypeDestroyCarrier_s)
     232        {
     233            this->setMetaTypeDirect(pickupMetaType::destroyCarrier);
     234        }
     235        else
     236            COUT(2) << "Invalid metaType '" << type << "' in MetaPickup." << std::endl;
     237    }
     238
    209239}
  • code/trunk/src/modules/pickup/items/MetaPickup.h

    r6709 r7163  
    4848            none,
    4949            use,
    50             drop
     50            drop,
     51            destroy,
     52            destroyCarrier
    5153        };
    5254    }
    53    
     55
    5456    /**
    5557    @brief
    56         The MetaPickup is a pickup that can, depending on the parameters, either drop all pickups of the PickupCarrier that picks it up, or use all the unused pickups of the PickupCarrier, that picks it up. The parameter to set for this is the metaType and it can be used with the values 'none', 'drop' and 'use'.
     58        The MetaPickup is a pickup that can, depending on the parameter 'metaType', do different things. If the 'metaType' is set to
     59        1) 'use', all the pickups, the PickupCarrier has, are immediately set to used upon pickup of the MetaPickup.
     60        2) 'drop', all the pickups, the PickupCarrier has, are immediately dropped upon pickup of the MetaPickup.
     61        3) 'destroy', all the pickups, the PickupCarrier has, are immediately destroyed upon pickup of the MetaPickup.
     62        4) 'destroyCarrier', the PickupCarrier is immediately destroyed upon pickup of the MetaPickup.
    5763    @author
    5864        Damian 'Mozork' Frick
     
    6066    class _PickupExport MetaPickup : public Pickup
    6167    {
    62        
     68
    6369        public:
    6470            MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object.
    6571            virtual ~MetaPickup(); //!< Destructor.
    66            
     72
    6773            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup object through XML.
    68            
     74
    6975            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    7076            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    71            
     77
    7278            /**
    7379            @brief Returns the meta type of the MetaPickup.
     
    7783                { return this->metaType_; }
    7884            const std::string& getMetaType(void); //!< Get the meta type of this MetaPickup.
    79            
     85
    8086        protected:
    8187            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    82            
     88
    8389            /**
    8490            @brief Set the meta type of the MetaPickup.
     
    8894                { this->metaType_ =  type; }
    8995            void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
    90            
     96
    9197        private:
    9298            void initialize(void); //!< Initializes the member variables.
    93            
     99
    94100            pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
    95            
     101
    96102            //! Static strings for the meta types.
    97103            static const std::string metaTypeNone_s;
    98104            static const std::string metaTypeUse_s;
    99105            static const std::string metaTypeDrop_s;
    100            
    101        
     106            static const std::string metaTypeDestroy_s;
     107            static const std::string metaTypeDestroyCarrier_s;
     108
     109
    102110    };
    103111
  • code/trunk/src/modules/pickup/items/SpeedPickup.cc

    r6755 r7163  
    136136        Engine* engine = this->carrierToEngineHelper();
    137137        if(engine == NULL) //!< If the PickupCarrier is no Engine, then this pickup is useless and therefore is destroyed.
    138             this->destroy();
    139        
     138            this->Pickupable::destroy();
     139
    140140        //! If the pickup has transited to used.
    141141        if(this->isUsed())
     
    156156            engine->setSpeedAdd(0.0f);
    157157            engine->setSpeedMultiply(1.0f);
    158            
     158
    159159            if(this->isOnce())
    160160            {
    161161                if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
    162162                {
    163                     this->destroy();
     163                    this->Pickupable::destroy();
    164164                }
    165165                else
     
    186186            COUT(1) << "Invalid PickupCarrier in SpeedPickup." << std::endl;
    187187        }
    188        
     188
    189189        return engine;
    190190    }
     
    269269
    270270    void SpeedPickup::pickupTimerCallback(void)
    271     {       
     271    {
    272272        this->setUsed(false);
    273273    }
  • code/trunk/src/modules/pickup/items/SpeedPickup.h

    r6709 r7163  
    7878        protected:
    7979            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    80            
     80
    8181            virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends.
    8282
Note: See TracChangeset for help on using the changeset viewer.