[Orxonox-commit 2185] r6901 - in code/trunk: data/levels src/modules/pickup src/orxonox/interfaces

dafrick at orxonox.net dafrick at orxonox.net
Sat May 15 08:47:14 CEST 2010


Author: dafrick
Date: 2010-05-15 08:47:07 +0200 (Sat, 15 May 2010)
New Revision: 6901

Modified:
   code/trunk/data/levels/pickup.oxw
   code/trunk/src/modules/pickup/PickupCollection.cc
   code/trunk/src/orxonox/interfaces/Pickupable.cc
   code/trunk/src/orxonox/interfaces/Pickupable.h
Log:
Fixed PickupCollection. It works now the way it was intended and no restructuring of the pickupsystem was necessary.


Modified: code/trunk/data/levels/pickup.oxw
===================================================================
--- code/trunk/data/levels/pickup.oxw	2010-05-14 10:41:04 UTC (rev 6900)
+++ code/trunk/data/levels/pickup.oxw	2010-05-15 06:47:07 UTC (rev 6901)
@@ -113,11 +113,11 @@
     
     <!-- Pickup Collection pickups -->
     
-    <!--PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
+    <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
         <pickup>
             <PickupCollection template=triplehealthspeedinvisibilitypickup />
         </pickup>
-    </PickupSpawner-->
+    </PickupSpawner>
     
   </Scene>
 </Level>

Modified: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc	2010-05-14 10:41:04 UTC (rev 6900)
+++ code/trunk/src/modules/pickup/PickupCollection.cc	2010-05-15 06:47:07 UTC (rev 6901)
@@ -122,7 +122,7 @@
         //! Change the PickupCarrier for all Pickupables this PickupCollection consists of.
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
-            (*it).get()->setCarrier(this->getCarrier());
+            (*it).get()->setCarrier(this->getCarrier()->getTarget(*it));
         }
     }
     

Modified: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-05-14 10:41:04 UTC (rev 6900)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-05-15 06:47:07 UTC (rev 6901)
@@ -101,7 +101,7 @@
     @return
         Returns true if the given PickupCarrier is a target.
     */
-    bool Pickupable::isTarget(const PickupCarrier* carrier) const
+    bool Pickupable::isTarget(PickupCarrier* carrier) const
     {
         if(carrier == NULL)
             return false;

Modified: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h	2010-05-14 10:41:04 UTC (rev 6900)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h	2010-05-15 06:47:07 UTC (rev 6901)
@@ -97,7 +97,7 @@
             bool pickedUp(PickupCarrier* carrier); //!< Sets the Pickupable to picked up.
             bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
             
-            virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
+            virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
             bool isTarget(const Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
             bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
             bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.




More information about the Orxonox-commit mailing list