[Orxonox-commit 1798] r6516 - code/branches/pickup3/src/modules/pickup
dafrick at orxonox.net
dafrick at orxonox.net
Thu Mar 11 22:59:37 CET 2010
Author: dafrick
Date: 2010-03-11 22:59:37 +0100 (Thu, 11 Mar 2010)
New Revision: 6516
Modified:
code/branches/pickup3/src/modules/pickup/DroppedPickup.cc
code/branches/pickup3/src/modules/pickup/DroppedPickup.h
code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
Log:
Resolved DroppedPickup bug, where the pickup picked up from a DroppedPickup was destroyed almost immediately after beign picked up, because the DroppedPickup was destroyed, and destroyed the pickup in its constructor.
Modified: code/branches/pickup3/src/modules/pickup/DroppedPickup.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedPickup.cc 2010-03-11 16:00:09 UTC (rev 6515)
+++ code/branches/pickup3/src/modules/pickup/DroppedPickup.cc 2010-03-11 21:59:37 UTC (rev 6516)
@@ -50,7 +50,6 @@
{
RegisterObject(DroppedPickup);
- this->initialize();
}
/**
@@ -68,9 +67,7 @@
DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 10, 1)
{
RegisterObject(DroppedPickup);
-
- this->initialize();
-
+
this->setPosition(position);
this->setActive(false);
this->startRespawnTimer();
@@ -82,20 +79,11 @@
*/
DroppedPickup::~DroppedPickup()
{
- if(this->gotPickedUp_ && this->pickup_ != NULL)
+ if(this->pickup_ != NULL && this->pickup_->isPickedUp())
{
this->pickup_ = NULL;
}
}
-
- /**
- @brief
- Initializes the member variables of the object.
- */
- void DroppedPickup::initialize(void)
- {
- this->gotPickedUp_ = false;
- }
/**
@brief
Modified: code/branches/pickup3/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedPickup.h 2010-03-11 16:00:09 UTC (rev 6515)
+++ code/branches/pickup3/src/modules/pickup/DroppedPickup.h 2010-03-11 21:59:37 UTC (rev 6516)
@@ -57,11 +57,6 @@
protected:
virtual Pickupable* getPickup(void); //!< Creates the Pickupable that is going to get picked up.
-
- private:
- void initialize(void); //!< Initializes the member variables of the object.
-
- bool gotPickedUp_; //!< Whether the pickup got picked up or not.
};
}
Modified: code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc 2010-03-11 16:00:09 UTC (rev 6515)
+++ code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc 2010-03-11 21:59:37 UTC (rev 6516)
@@ -43,6 +43,7 @@
Constructor. Registers the object and initializes its member variables.
This is primarily for use of the PickupManager in creating a default PickupRepresentation.
*/
+ //TODO: Not this as creator!!!
PickupRepresentation::PickupRepresentation() : BaseObject(this)
{
this->spawnerRepresentation_ = NULL;
More information about the Orxonox-commit
mailing list