- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/orxonox/weaponsystem/Munition.cc
r11052 r11054 57 57 Munition::~Munition() 58 58 { 59 for ( std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)60 delete it->second;59 for (const auto& mapEntry : this->assignedMagazines_) 60 delete mapEntry.second; 61 61 } 62 62 … … 76 76 // For separated magazines we definitively need a given user 77 77 if (!user) 78 return 0;78 return nullptr; 79 79 80 80 // Use the map to get the magazine assigned to the given user … … 90 90 } 91 91 92 return 0;92 return nullptr; 93 93 } 94 94 … … 262 262 if (deployment_ != MunitionDeployment::Separate) 263 263 { 264 user = NULL;264 user = nullptr; 265 265 } 266 266 … … 299 299 { 300 300 // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition) 301 for ( std::map<WeaponMode*, Magazine*>::const_iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)302 if ( it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)301 for (const auto& mapEntry : this->assignedMagazines_) 302 if (mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_) 303 303 return true; 304 304 } … … 515 515 // If we don't use separate magazines, set user to 0 516 516 if (deployment_ != MunitionDeployment::Separate) 517 user = NULL;517 user = nullptr; 518 518 519 519 // Remove the current magazine for the given user
Note: See TracChangeset
for help on using the changeset viewer.