Changeset 5440 in orxonox.OLD for trunk/src/world_entities/weapons/weapon_manager.cc
- Timestamp:
- Oct 27, 2005, 10:56:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/weapon_manager.cc
r5435 r5440 220 220 if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount)) 221 221 { 222 PRINTF(2)("Slot %d of config %d is not availiabe \n", slotID, configID);222 PRINTF(2)("Slot %d of config %d is not availiabe (max: %d)\n", slotID, configID, this->slotCount); 223 223 return; 224 224 } … … 238 238 239 239 //! @todo check if the weapon is already assigned to another config in another slot 240 241 240 this->configs[configID][slotID] = weapon; 242 241 if (this->parent != NULL) … … 403 402 * @param the selected weaponconfig 404 403 */ 405 int WeaponManager::getNextFreeSlot(int configID )404 int WeaponManager::getNextFreeSlot(int configID, long capability) 406 405 { 407 406 for( int i = 0; i < this->slotCount; ++i) 408 407 { 409 if( this->configs[configID][i] == NULL) 408 if( this->configs[configID][i] == NULL && 409 (this->currentSlotConfig[i].capability & capability == this->currentSlotConfig[i].capability)) 410 410 return i; 411 411 }
Note: See TracChangeset
for help on using the changeset viewer.