Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 22, 2011, 5:59:40 PM (14 years ago)
Author:
dafrick
Message:

Possible bug fix in PickupCarrier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/interfaces/PickupCarrier.cc

    r7547 r8297  
    6666    {
    6767        std::set<Pickupable*>::iterator it = this->pickups_.begin();
    68         std::set<Pickupable*>::iterator temp;
     68        Pickupable* temp;
     69        // Iterate over all pickups that are attached to this PickupCarrier and destroy them.
    6970        while(it != this->pickups_.end())
    7071        {
     72            temp = *it;
    7173            (*it)->carrierDestroyed();
    72             temp = it;
    7374            it = this->pickups_.begin();
    74             if(it == temp) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
     75            if(temp == *it) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
    7576            {
    76                 COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << (*temp) << ") didn't unregister itself as it should have." << std::endl;;
     77                COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << temp << ") didn't unregister itself as it should have." << std::endl;;
    7778                it++;
    7879            }
Note: See TracChangeset for help on using the changeset viewer.