Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 2, 2010, 6:47:57 PM (14 years ago)
Author:
landauf
Message:

Fixed a bug in PickupSpawner.

When one Pawn picked up the last item, spawnsRemaining_ became 0 and the PickupSpawner was destroyed immediately. But PickupSpawner::tick() continued iterating through the other pawns, which lead to a crash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/pickup/PickupSpawner.cc

    r7038 r7086  
    176176        if (this->isActive())
    177177        {
     178            SmartPtr<PickupSpawner> temp = this; // create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
     179           
    178180            //! Iterate trough all Pawns.
    179181            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
Note: See TracChangeset for help on using the changeset viewer.