- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 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/Weapon.cc
r11052 r11054 45 45 RegisterObject(Weapon); 46 46 47 this->weaponPack_ = 0;48 this->weaponSlot_ = 0;47 this->weaponPack_ = nullptr; 48 this->weaponSlot_ = nullptr; 49 49 this->bReloading_ = false; 50 50 this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED; … … 61 61 this->weaponPack_->removeWeapon(this); 62 62 63 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)64 it->second->destroy();63 for (const auto& mapEntry : this->weaponmodes_) 64 mapEntry.second->destroy(); 65 65 } 66 66 } … … 85 85 { 86 86 unsigned int i = 0; 87 for ( std::multimap<unsigned int, WeaponMode*>::const_iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)87 for (const auto& mapEntry : this->weaponmodes_) 88 88 { 89 89 if (i == index) 90 return it->second;90 return mapEntry.second; 91 91 92 92 ++i; 93 93 } 94 return 0;94 return nullptr; 95 95 } 96 96 … … 140 140 void Weapon::reload() 141 141 { 142 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)143 it->second->reload();142 for (const auto& mapEntry : this->weaponmodes_) 143 mapEntry.second->reload(); 144 144 } 145 145 … … 152 152 void Weapon::notifyWeaponModes() 153 153 { 154 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)155 it->second->setWeapon(this);154 for (const auto& mapEntry : this->weaponmodes_) 155 mapEntry.second->setWeapon(this); 156 156 } 157 157
Note: See TracChangeset
for help on using the changeset viewer.