Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2005, 10:56:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Weapons update, Now one can really assign SlotCapabilities
Debug-redesign (small)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5435 r5440  
    220220  if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount))
    221221  {
    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);
    223223    return;
    224224  }
     
    238238
    239239  //! @todo check if the weapon is already assigned to another config in another slot
    240 
    241240  this->configs[configID][slotID] = weapon;
    242241  if (this->parent != NULL)
     
    403402 * @param the selected weaponconfig
    404403 */
    405 int WeaponManager::getNextFreeSlot(int configID)
     404int WeaponManager::getNextFreeSlot(int configID, long capability)
    406405{
    407406  for( int i = 0; i < this->slotCount; ++i)
    408407  {
    409     if( this->configs[configID][i] == NULL)
     408    if( this->configs[configID][i] == NULL &&
     409        (this->currentSlotConfig[i].capability & capability == this->currentSlotConfig[i].capability))
    410410      return i;
    411411  }
Note: See TracChangeset for help on using the changeset viewer.