- Timestamp:
- Nov 28, 2016, 7:21:35 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11305 r11314 83 83 } 84 84 85 void PickupManager::setPickupSystem(HUDPickupSystem* system)86 {87 pickupSystem=system;88 }89 90 85 /** 91 86 @brief … … 271 266 assert(pickup); 272 267 268 if(!pickupSystem) 269 { 270 for (HUDPickupSystem* hud : ObjectList<HUDPickupSystem>()) 271 pickupSystem = hud; 272 } 273 assert(pickupSystem); //pickupSystem HAS to be there! 274 273 275 if(!GameMode::isMaster()) // If this is neither standalone nor the server. 274 276 return; … … 299 301 this->pickups_[index] = pickup; 300 302 301 //TODO 302 std::vector<Pickupable*> picks; 303 304 PickupManager& manager = PickupManager::getInstance(); 305 306 Pickupable* pickup = nullptr; 307 308 for(uint32_t i = 0; i!=10; i++) 309 { 310 pickup=manager.pickups_.find(i)->second; 311 picks.push_back(pickup); 312 } 313 // pickupSystem->updatePickupList(picks); 303 orxout() << "the pickup is: " << pickup << endl; 304 305 this->picks.push_back(pickup); 306 307 pickupSystem->updatePickupList(picks); 314 308 315 309 } … … 320 314 index = it->second; 321 315 322 323 316 this->indexes_.erase(pickup); 324 317 this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex() 318 319 320 this->picks.erase(std::remove(this->picks.begin(), this->picks.end(), pickup), this->picks.end()); //remove pickup from vector 321 322 pickupSystem->removePickup(pickup); 323 pickupSystem->updatePickupList(picks); 325 324 } 326 325
Note: See TracChangeset
for help on using the changeset viewer.