Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2016, 6:34:27 PM (7 years ago)
Author:
patricwi
Message:

visualization finished, bug when ending or reloading the level

File:
1 edited

Legend:

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

    r11323 r11325  
    314314
    315315            this->indexes_.erase(pickup);
    316             this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex()
     316            this->pickups_.erase(index); //set to null, so that can be identified as free slot by getPickupIndex()
    317317
    318318
     
    355355        PickupManager& manager = PickupManager::getInstance();
    356356
     357        if(!manager.pickups_.count(index)) return; //if pickup is no longer here, dont do anything
     358
    357359        Pickupable* pickup=manager.pickups_.find(index)->second;
    358360        if(pickup==nullptr)
     
    364366        orxout() << "The pickup is being used: " << pickup->isUsed() << endl;
    365367
    366         pickup->drop(true);
     368        manager.dropPickup(index);
     369
    367370        // if(pickup->isUsed())
    368371        //     manager.usePickup(index, false);
     
    557560        for(uint32_t i=0; i<10; i++)
    558561        {
    559             if(pickups_.find(i)->second==nullptr) return i;
     562            if(!pickups_.count(i)) return i;
    560563        }
    561564        //all slots are full and we have to drop sth
Note: See TracChangeset for help on using the changeset viewer.