[Orxonox-commit 1990] r6707 - code/branches/pickup4/src/modules/pickup

dafrick at orxonox.net dafrick at orxonox.net
Tue Apr 13 08:46:21 CEST 2010


Author: dafrick
Date: 2010-04-13 08:46:20 +0200 (Tue, 13 Apr 2010)
New Revision: 6707

Modified:
   code/branches/pickup4/src/modules/pickup/PickupSpawner.cc
Log:
Found bug in PickupSpawner.


Modified: code/branches/pickup4/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup4/src/modules/pickup/PickupSpawner.cc	2010-04-12 22:41:52 UTC (rev 6706)
+++ code/branches/pickup4/src/modules/pickup/PickupSpawner.cc	2010-04-13 06:46:20 UTC (rev 6707)
@@ -179,8 +179,9 @@
             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
             {
                 Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
+                PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(*it);
                 //! If a Pawn, that fits the target-range of the item spawned by this Pickup, is in trigger-distance.
-                if (distance.length() < this->triggerDistance_ && this->pickup_->isTarget(*it))
+                if (distance.length() < this->triggerDistance_ && carrier != NULL && carrier->isTarget(this->pickup_))
                 {
                     this->trigger(*it);
                 }




More information about the Orxonox-commit mailing list