Changeset 7539 for code/trunk
- Timestamp:
- Oct 13, 2010, 10:57:13 PM (14 years ago)
- Location:
- code/trunk/src/modules/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupManager.cc
r7533 r7539 34 34 #include "PickupManager.h" 35 35 36 #include "util/Convert.h"37 #include "util/ScopedSingletonManager.h"38 36 #include "core/CoreIncludes.h" 39 37 #include "core/LuaState.h" … … 42 40 #include "network/Host.h" 43 41 #include "network/NetworkFunction.h" 44 42 #include "util/ScopedSingletonManager.h" 43 44 #include "infos/PlayerInfo.h" 45 45 #include "interfaces/PickupCarrier.h" 46 #include "infos/PlayerInfo.h"47 46 #include "worldentities/pawns/Pawn.h" 48 47 … … 96 95 this->representationsNetworked_.clear(); 97 96 98 //TODO: Destroying properly?99 //TODO: Shouldnt these list be empty, to avoid problems when switching levels?100 97 // Destroying all the PickupInventoryContainers that are still there. 101 98 for(std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.begin(); it != this->pickupInventoryContainers_.end(); it++) … … 484 481 { 485 482 // If we're either server or standalone and the list of pickups is not empty, we find and drop the input pickup. 486 if(GameMode::isMaster() && !this->pickups_.empty()) 487 { 483 if(GameMode::isMaster()) 484 { 485 if(this->pickups_.empty()) 486 return; 488 487 Pickupable* pickupable = this->pickups_.find(pickup)->second->get(); 489 488 if(pickupable != NULL) … … 509 508 { 510 509 PickupManager& manager = PickupManager::getInstance(); 511 //TODO: Just call dropPickup() on manager? 512 if(manager.pickups_.empty()) 513 return; 514 Pickupable* pickupable = manager.pickups_.find(pickup)->second->get(); 515 if(pickupable != NULL) 516 pickupable->drop(); 510 manager.dropPickup(pickup); 517 511 } 518 512 } … … 530 524 { 531 525 // If we're either server or standalone and the list of pickups is not empty, we find and change the used status of the input pickup. 532 if(GameMode::isMaster() && !this->pickups_.empty()) 533 { 526 if(GameMode::isMaster()) 527 { 528 if(this->pickups_.empty()) 529 return; 534 530 Pickupable* pickupable = this->pickups_.find(pickup)->second->get(); 535 531 if(pickupable != NULL) … … 557 553 { 558 554 PickupManager& manager = PickupManager::getInstance(); 559 //TODO: Just call usePickup() on manager? 560 if(manager.pickups_.empty()) 561 return; 562 Pickupable* pickupable = manager.pickups_.find(pickup)->second->get(); 563 if(pickupable != NULL) 564 pickupable->setUsed(use); 555 manager.usePickup(pickup, use); 565 556 } 566 557 } -
code/trunk/src/modules/pickup/PickupRepresentation.h
r7504 r7539 54 54 The PickupRepresentation class represents a specific pickup type (identified by its PickupIdentifier). It defines the information displayed in the GUI and how PickupSpawners that spawn the pickup type look like. 55 55 They are created through XML and are registered with the PickupManager. 56 57 @author 58 Damian 'Mozork' Frick 59 60 @ingroup Pickup 56 61 */ 57 62 class _PickupExport PickupRepresentation // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.