- Timestamp:
- Dec 12, 2016, 4:20:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11325 r11336 266 266 assert(pickup); 267 267 268 269 268 for (HUDPickupSystem* hud : ObjectList<HUDPickupSystem>()) 270 269 pickupSystem = hud; 271 270 272 assert(pickupSystem); //pickupSystem HAS to be there!273 274 271 if(!GameMode::isMaster()) // If this is neither standalone nor the server. 275 272 return; … … 300 297 this->pickups_[index] = pickup; 301 298 302 orxout() << "the pickup is: " << pickup << endl;303 304 299 this->picks.push_back(pickup); 305 300 306 pickupSystem->updatePickupList(picks); 301 if(pickupSystem) 302 pickupSystem->updatePickupList(picks, indexes_); 307 303 308 304 } … … 319 315 this->picks.erase(std::remove(this->picks.begin(), this->picks.end(), pickup), this->picks.end()); //remove pickup from vector 320 316 321 pickupSystem->removePickup(pickup); 317 if(pickupSystem) 318 pickupSystem->removePickup(pickup); 322 319 } 323 320 … … 349 346 //This function is called by the command line or by the key binding 350 347 //it uses or unuses the pickup, depending on its current state 348 //or drops it (depends what you comment/uncomment) 351 349 void PickupManager::useUnusePickup(uint32_t index) 352 350 { 353 orxout() << "Hello there I was here " << index << endl;354 355 351 PickupManager& manager = PickupManager::getInstance(); 356 352 … … 360 356 if(pickup==nullptr) 361 357 { 362 orxout() << "The pickup does not exist." << endl;363 358 return; //pickup does not exist 364 359 } 365 360 366 orxout() << "The pickup is being used: " << pickup->isUsed() << endl; 367 361 //if the pickup should be dropped upon key press 368 362 manager.dropPickup(index); 363 364 //if the pickup should be used/unused upon key press 369 365 370 366 // if(pickup->isUsed()) … … 563 559 } 564 560 //all slots are full and we have to drop sth 565 orxout( ) << "everything was full and we have now dropped the first element" << endl;561 orxout(internal_info, context::pickups) << "everything was full and we have now dropped the first element" << endl; 566 562 this->dropPickup(0); 567 563 return 0;
Note: See TracChangeset
for help on using the changeset viewer.