Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7008


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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/data/levels/pickups.oxw

    r7007 r7008  
    2525    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    2626    <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    27 
    2827
    2928    <!-- Shield pickups -->
     
    135134    <!-- Pickup Collection pickups -->
    136135
    137     <PickupSpawner position="-50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     136    <PickupSpawner position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
    138137      <pickup>
    139138        <PickupCollection template=triplehealthspeedinvisibilitypickup />
     
    141140    </PickupSpawner>
    142141
    143         <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     142    <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
    144143    <PickupRepresentation
    145144      pickupName = "Medium Health Pack"
     
    153152    </PickupRepresentation>
    154153
    155     <PickupSpawner position="-50,25,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
     154    <PickupSpawner position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
    156155      <pickup>
    157         <HealthPickup health=50 activationType=onUse durationType=continuous />
     156        <HealthPickup health=50 activationType=onUse durationType=once />
    158157      </pickup>
    159158    </PickupSpawner>
  • code/branches/presentation3/src/libraries/core/OrxonoxClass.h

    r6524 r7008  
    173173    };
    174174   
    175     SUPER_FUNCTION(11, OrxonoxClass, clone, true);
     175    SUPER_FUNCTION(11, OrxonoxClass, clone, false);
    176176   
    177177}
  • 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.