- Timestamp:
- Nov 21, 2015, 7:05:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc
r10768 r10821 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 (auto & elem : this->weaponmodes_) 64 elem.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 & elem : this->weaponmodes_) 88 88 { 89 89 if (i == index) 90 return it->second;90 return elem.second; 91 91 92 92 ++i; … … 136 136 void Weapon::reload() 137 137 { 138 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)139 it->second->reload();138 for (auto & elem : this->weaponmodes_) 139 elem.second->reload(); 140 140 } 141 141 … … 148 148 void Weapon::notifyWeaponModes() 149 149 { 150 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)151 it->second->setWeapon(this);150 for (auto & elem : this->weaponmodes_) 151 elem.second->setWeapon(this); 152 152 } 153 153 }
Note: See TracChangeset
for help on using the changeset viewer.