Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2005, 1:41:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: states are now flow'n through

File:
1 edited

Legend:

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

    r4895 r4906  
    7575      this->configs[i].slots[j] = NULL;
    7676  }
    77   this->currConfID = W_CONFIG0;
     77  this->currConfID = WM_CONFIG0;
    7878
    7979
     
    141141 *
    142142 * if you add explicitly a weapon at config:n, slot:m, the weapon placed at this location will be
    143  * replaced by the weapon specified. if you use the W_FREE_SLOT, the manager will look for a free
     143 * replaced by the weapon specified. if you use the WM_FREE_SLOT, the manager will look for a free
    144144 * slot in this weaponconfiguration. if there is non, the weapon won't be added and there will be
    145145 * a error message.
     
    147147void WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)
    148148{
    149   if( slotID == W_FREE_SLOT)
     149  if( slotID == WM_FREE_SLOT)
    150150  {
    151151    int freeSlot = this->getNextFreeSlot( configID);
     
    187187  lastConfID = this->currConfID;
    188188  for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
    189   if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
     189  if( i == W_MAX_CONFIGS) this->currConfID = WM_CONFIG0;
    190190  else this->currConfID = i;
    191191
     
    241241{
    242242  Weapon* w;
    243   for (int j = 0; j < 4; ++j )
    244     for(int i = 0; i < W_MAX_SLOTS; ++i)
    245   {
    246     w = this->configs[j].slots[i];
    247     if( w != NULL) w->tick(dt);
     243  for(int i = 0; i < W_MAX_SLOTS; ++i)
     244  {
     245    w = this->configs[this->currConfID].slots[i];
     246    if( w != NULL && w->isActive())
     247      w->tickW(dt);
    248248  }
    249249
     
    262262  {
    263263    w = this->configs[j].slots[i];
    264     if( w != NULL)
     264    if( w != NULL && w->isVisible())
    265265      w->draw();
    266266  }
Note: See TracChangeset for help on using the changeset viewer.