Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6516


Ignore:
Timestamp:
Mar 11, 2010, 10:59:37 PM (14 years ago)
Author:
dafrick
Message:

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.

Location:
code/branches/pickup3/src/modules/pickup
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/modules/pickup/DroppedPickup.cc

    r6512 r6516  
    5151        RegisterObject(DroppedPickup);
    5252       
    53         this->initialize();
    5453    }
    5554
     
    6968    {   
    7069        RegisterObject(DroppedPickup);
    71        
    72         this->initialize();
    73        
     70
    7471        this->setPosition(position);
    7572        this->setActive(false);
     
    8380    DroppedPickup::~DroppedPickup()
    8481    {
    85         if(this->gotPickedUp_ && this->pickup_ != NULL)
     82        if(this->pickup_ != NULL && this->pickup_->isPickedUp())
    8683        {
    8784            this->pickup_ = NULL;
    8885        }
    89     }
    90    
    91     /**
    92     @brief
    93         Initializes the member variables of the object.
    94     */
    95     void DroppedPickup::initialize(void)
    96     {
    97         this->gotPickedUp_ = false;
    9886    }
    9987
  • code/branches/pickup3/src/modules/pickup/DroppedPickup.h

    r6496 r6516  
    5858        protected:
    5959            virtual Pickupable* getPickup(void); //!< Creates the Pickupable that is going to get picked up.
    60            
    61         private:
    62             void initialize(void); //!< Initializes the member variables of the object.
    63            
    64             bool gotPickedUp_; //!< Whether the pickup got picked up or not.
    6560
    6661    };
  • code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc

    r6512 r6516  
    4444        This is primarily for use of the PickupManager in creating a default PickupRepresentation.
    4545    */
     46    //TODO: Not this as creator!!!
    4647    PickupRepresentation::PickupRepresentation() : BaseObject(this)
    4748    {
Note: See TracChangeset for help on using the changeset viewer.