[Orxonox-commit 1996] r6713 - code/trunk/src/modules/pickup/items

dafrick at orxonox.net dafrick at orxonox.net
Tue Apr 13 10:49:13 CEST 2010


Author: dafrick
Date: 2010-04-13 10:49:13 +0200 (Tue, 13 Apr 2010)
New Revision: 6713

Modified:
   code/trunk/src/modules/pickup/items/SpeedPickup.cc
Log:
Adjusted SpeedPickup such that the Engine is the actual PickupCarrier now. (and not the Pawn)


Modified: code/trunk/src/modules/pickup/items/SpeedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.cc	2010-04-13 08:46:39 UTC (rev 6712)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.cc	2010-04-13 08:49:13 UTC (rev 6713)
@@ -78,7 +78,7 @@
         this->speedAdd_ = 0.0f;
         this->speedMultiply_ = 1.0f;
 
-        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+        this->addTarget(ClassIdentifier<Engine>::getIdentifier());
     }
 
     /**
@@ -165,18 +165,14 @@
     Engine* SpeedPickup::carrierToEngineHelper(void)
     {
         PickupCarrier* carrier = this->getCarrier();
-        SpaceShip* ship = dynamic_cast<SpaceShip*>(carrier);
+        Engine* engine = dynamic_cast<Engine*>(carrier);
 
-        if(ship == NULL)
+        if(engine == NULL)
         {
             COUT(1) << "Invalid PickupCarrier in SpeedPickup." << std::endl;
         }
-        else
-        {
-            return ship->getEngine();
-        }
-
-        return 0;
+        
+        return engine;
     }
 
     /**




More information about the Orxonox-commit mailing list