Changeset 11071 for code/trunk/src/modules/pickup/PickupManager.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/pickup/PickupManager.cc
r10624 r11071 68 68 Constructor. Registers the PickupManager and creates the default PickupRepresentation. 69 69 */ 70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_( NULL)70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_(nullptr) 71 71 { 72 72 RegisterObject(PickupManager); … … 85 85 { 86 86 // Destroying the default representation. 87 if(this->defaultRepresentation_ != NULL)87 if(this->defaultRepresentation_ != nullptr) 88 88 this->defaultRepresentation_->destroy(); 89 89 … … 91 91 92 92 // Destroying all the PickupInventoryContainers that are still there. 93 for( std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.begin(); it != this->pickupInventoryContainers_.end(); it++)94 delete it->second;93 for(const auto& mapEntry : this->pickupInventoryContainers_) 94 delete mapEntry.second; 95 95 this->pickupInventoryContainers_.clear(); 96 96 … … 184 184 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 185 185 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 186 if(collectible != NULL&& collectible->isInCollection())186 if(collectible != nullptr && collectible->isInCollection()) 187 187 return; 188 188 189 189 // Getting clientId of the host this change of the pickup's used status concerns. 190 190 PickupCarrier* carrier = pickup->getCarrier(); 191 while(carrier->getCarrierParent() != NULL)191 while(carrier->getCarrierParent() != nullptr) 192 192 carrier = carrier->getCarrierParent(); 193 193 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 194 if(pawn == NULL)194 if(pawn == nullptr) 195 195 return; 196 196 PlayerInfo* info = pawn->getPlayer(); 197 if(info == NULL)197 if(info == nullptr) 198 198 return; 199 199 unsigned int clientId = info->getClientID(); … … 265 265 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 266 266 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 267 if(collectible != NULL&& collectible->isInCollection())267 if(collectible != nullptr && collectible->isInCollection()) 268 268 return; 269 269 270 270 // Getting clientId of the host this change of the pickup's pickedUp status concerns. 271 271 PickupCarrier* carrier = pickup->getCarrier(); 272 while(carrier->getCarrierParent() != NULL)272 while(carrier->getCarrierParent() != nullptr) 273 273 carrier = carrier->getCarrierParent(); 274 274 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 275 if(pawn == NULL)275 if(pawn == nullptr) 276 276 return; 277 277 PlayerInfo* info = pawn->getFormerPlayer(); 278 if(info == NULL)278 if(info == nullptr) 279 279 return; 280 280 unsigned int clientId = info->getClientID(); … … 399 399 return; 400 400 Pickupable* pickupable = this->pickups_.find(pickup)->second; 401 if(pickupable != NULL)401 if(pickupable != nullptr) 402 402 pickupable->drop(); 403 403 } … … 442 442 return; 443 443 Pickupable* pickupable = this->pickups_.find(pickup)->second; 444 if(pickupable != NULL)444 if(pickupable != nullptr) 445 445 pickupable->setUsed(use); 446 446 }
Note: See TracChangeset
for help on using the changeset viewer.