Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 8, 2010, 8:53:52 PM (14 years ago)
Author:
dafrick
Message:

Significant structural changes to the pickup module. Lots of bugs found and fixed.
Introduced a new class CollectiblePickup (which is now the only kind a PickupCollection can consist of) to solve some issues cleanly.
MetaPickup received additional functionality. It can now also be set to either destroy all the pickups of a PickupCarrier or destroy the PickupCarrier itself. (This was done mainly for testing purposes)
I've done some extensive testing on the pickups, so they should really work now.

File:
1 edited

Legend:

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

    r7150 r7162  
    4343#include "infos/PlayerInfo.h"
    4444#include "worldentities/pawns/Pawn.h"
     45#include "CollectiblePickup.h"
    4546#include "PickupRepresentation.h"
    4647
     
    6465        RegisterRootObject(PickupManager);
    6566
     67        //TODO: This doesn't work, yet.
    6668        if( GameMode::showsGraphics() )
    6769        {
     
    172174            for(std::set<Pickupable*>::iterator pickup = pickups.begin(); pickup != pickups.end(); pickup++)
    173175            {
    174                 this->pickupsList_.insert(std::pair<Pickupable*, WeakPtr<Pickupable> >(*pickup, WeakPtr<Pickupable>(*pickup)));
     176                CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(*pickup);
     177                if(collectible == NULL || !collectible->isInCollection())
     178                    this->pickupsList_.insert(std::pair<Pickupable*, WeakPtr<Pickupable> >(*pickup, WeakPtr<Pickupable>(*pickup)));
    175179            }
    176180        }
Note: See TracChangeset for help on using the changeset viewer.