Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5965 in orxonox.OLD for branches/powerups/src/world_entities/weapons


Ignore:
Timestamp:
Dec 7, 2005, 3:45:26 PM (19 years ago)
Author:
manuel
Message:

many changes:
created generic weapon_power_up that can contain any kind of weapon
space_ship is now extendable and can pickup weapon_power_ups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/world_entities/weapons/weapon_manager.cc

    r5955 r5965  
    408408
    409409/**
    410  * private gets the next free slot in a certain weaponconfig
     410 * gets the next free slot in a certain weaponconfig
    411411 * @param the selected weaponconfig
    412412 */
    413413int WeaponManager::getNextFreeSlot(int configID, long capability)
    414414{
    415   for( int i = 0; i < this->slotCount; ++i)
    416   {
    417     if( this->configs[configID][i] == NULL &&
    418         (this->currentSlotConfig[i].capability & capability & WTYPE_ALLKINDS) &&
    419         (this->currentSlotConfig[i].capability & capability & WTYPE_ALLDIRS))
    420       return i;
    421   }
     415  /*if(configID == -1) {
     416    for(int i = 0; i < WM_MAX_CONFIGS; ++i)
     417    {
     418      int slot = this->getNextFreeSlot(i, capability);
     419      if(slot >= 0) return slot;
     420    }
     421  }
     422  else {*/
     423    for( int i = 0; i < this->slotCount; ++i)
     424    {
     425      if( this->configs[configID][i] == NULL &&
     426          (this->currentSlotConfig[i].capability & capability & WTYPE_ALLKINDS) &&
     427          (this->currentSlotConfig[i].capability & capability & WTYPE_ALLDIRS))
     428        return i;
     429    }
     430  //}
    422431  return -1;
    423432}
Note: See TracChangeset for help on using the changeset viewer.