[Orxonox-commit 2293] orxonox r7008 - in code/branches/presentation3: data/levels src/libraries/core src/modules/pickup src/modules/pickup/items
dafrick at orxonox.net
dafrick at orxonox.net
Sun May 30 12:21:28 CEST 2010
Author: dafrick
Date: 2010-05-29 21:33:33 +0200 (Sat, 29 May 2010)
New Revision: 7008
Modified:
code/branches/presentation3/data/levels/pickups.oxw
code/branches/presentation3/src/libraries/core/OrxonoxClass.h
code/branches/presentation3/src/modules/pickup/Pickup.cc
code/branches/presentation3/src/modules/pickup/Pickup.h
code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc
Log:
Fixed a bug in pickups that caused the clone method of Pickup.h not to be called via SUPER.
Modified: code/branches/presentation3/data/levels/pickups.oxw
===================================================================
--- code/branches/presentation3/data/levels/pickups.oxw 2010-05-29 18:41:19 UTC (rev 7007)
+++ code/branches/presentation3/data/levels/pickups.oxw 2010-05-29 19:33:33 UTC (rev 7008)
@@ -25,7 +25,6 @@
<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" />
<SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
-
<!-- Shield pickups -->
<PickupSpawner position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
@@ -134,13 +133,13 @@
<!-- Pickup Collection pickups -->
- <PickupSpawner position="-50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
+ <PickupSpawner position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
<pickup>
<PickupCollection template=triplehealthspeedinvisibilitypickup />
</pickup>
</PickupSpawner>
- <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
+ <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
<PickupRepresentation
pickupName = "Medium Health Pack"
pickupDescription = "Once used adds a medium amout of health to the ship."
@@ -152,9 +151,9 @@
</pickup>
</PickupRepresentation>
- <PickupSpawner position="-50,25,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
+ <PickupSpawner position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
<pickup>
- <HealthPickup health=50 activationType=onUse durationType=continuous />
+ <HealthPickup health=50 activationType=onUse durationType=once />
</pickup>
</PickupSpawner>
Modified: code/branches/presentation3/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/presentation3/src/libraries/core/OrxonoxClass.h 2010-05-29 18:41:19 UTC (rev 7007)
+++ code/branches/presentation3/src/libraries/core/OrxonoxClass.h 2010-05-29 19:33:33 UTC (rev 7008)
@@ -172,7 +172,7 @@
std::vector<std::pair<unsigned int, void*> > objectPointers_;
};
- SUPER_FUNCTION(11, OrxonoxClass, clone, true);
+ SUPER_FUNCTION(11, OrxonoxClass, clone, false);
}
Modified: code/branches/presentation3/src/modules/pickup/Pickup.cc
===================================================================
--- code/branches/presentation3/src/modules/pickup/Pickup.cc 2010-05-29 18:41:19 UTC (rev 7007)
+++ code/branches/presentation3/src/modules/pickup/Pickup.cc 2010-05-29 19:33:33 UTC (rev 7008)
@@ -48,6 +48,8 @@
/*static*/ const std::string Pickup::durationTypeOnce_s = "once";
/*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
+ CreateUnloadableFactory(Pickup);
+
Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
{
RegisterObject(Pickup);
@@ -145,11 +147,11 @@
*/
void Pickup::setActivationType(const std::string& type)
{
- if(Pickup::activationTypeImmediate_s.compare(type))
+ if(Pickup::activationTypeImmediate_s.compare(type) == 0)
{
this->activationType_ = pickupActivationType::immediate;
}
- else if(Pickup::activationTypeOnUse_s.compare(type))
+ else if(Pickup::activationTypeOnUse_s.compare(type) == 0)
{
this->activationType_ = pickupActivationType::onUse;
}
Modified: code/branches/presentation3/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/presentation3/src/modules/pickup/Pickup.h 2010-05-29 18:41:19 UTC (rev 7007)
+++ code/branches/presentation3/src/modules/pickup/Pickup.h 2010-05-29 19:33:33 UTC (rev 7008)
@@ -76,10 +76,8 @@
class _PickupExport Pickup : public Pickupable, public BaseObject
{
- protected:
- Pickup(BaseObject* creator); //!< Constructor.
-
public:
+ Pickup(BaseObject* creator); //!< Constructor.
virtual ~Pickup(); //!< Destructor.
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Modified: code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc 2010-05-29 18:41:19 UTC (rev 7007)
+++ code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc 2010-05-29 19:33:33 UTC (rev 7008)
@@ -188,7 +188,7 @@
void HealthPickup::changedUsed(void)
{
SUPER(HealthPickup, changedUsed);
-
+
//! If the pickup is not picked up nothing must be done.
if(!this->isPickedUp())
return;
@@ -289,9 +289,9 @@
{
if(item == NULL)
item = new HealthPickup(this);
-
+
SUPER(HealthPickup, clone, item);
-
+
HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
pickup->setHealth(this->getHealth());
pickup->setHealthRate(this->getHealthRate());
More information about the Orxonox-commit
mailing list