Changeset 4954 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
- Timestamp:
- Jul 25, 2005, 2:16:23 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4953 r4954 203 203 204 204 /** 205 * sets the capabilities of a Slot 206 * @param slot the slot to set the capability 207 * @param slotCapability the capability @see WM_SlotCapability 208 */ 209 void WeaponManager::setSlotCapability(int slot, long slotCapability) 210 { 211 if (slot > slotCount) 212 return; 213 this->currentSlotConfig[slot].capability = slotCapability; 214 } 215 216 217 /** 205 218 * removes a Weapon from the WeaponManager 219 * 220 * !! The weapon must be inactive before you can delete it, !! 221 * !! because it will still be deactivated (if it is selected) !! 206 222 */ 207 223 void WeaponManager::removeWeapon(Weapon* weapon, int configID) 208 224 { 209 /* empty */ 225 if (weapon == NULL) 226 return; 227 if (configID < 0) 228 { 229 for (int j = 0; j < WM_MAX_SLOTS; j++) 230 { 231 for (int i = 0; i < WM_MAX_CONFIGS; i++) 232 { 233 if (this->configs[i][j] == weapon) 234 this->configs[i][j] = NULL; 235 } 236 if (this->currentSlotConfig[j].currentWeapon == weapon) 237 { 238 this->currentSlotConfig[j].nextWeapon = NULL; 239 } 240 } 241 } 210 242 } 211 243 … … 214 246 * changes to the next weapon configuration 215 247 */ 216 void WeaponManager::nextWeaponConf ()248 void WeaponManager::nextWeaponConfig() 217 249 { 218 250 ++this->currentConfigID;
Note: See TracChangeset
for help on using the changeset viewer.