Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3875 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.cc


Ignore:
Timestamp:
Apr 18, 2005, 4:52:45 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: weapon manager now works in player, cleaning up the rest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapon.cc

    r3873 r3875  
    3939  this->nrOfSlots = nrOfSlots;
    4040 
    41   this->currConfID = W_CONFIG1;
     41  for(int i = 0; i < W_MAX_CONFIGS; ++i)
     42    for(int j = 0; j < W_MAX_SLOTS; ++j)
     43      this->configs[i].slots[j] = NULL;
     44
     45  this->currConfID = W_CONFIG0;
    4246  this->configs[this->currConfID].bUsed = true;
    4347}
     
    9195
    9296
     97void WeaponManager::fire()
     98{
     99  Weapon* firingWeapon;
     100  for(int i = 0; i < W_MAX_SLOTS; ++i)
     101    {
     102      firingWeapon = this->configs[this->currConfID].slots[i];
     103      if( firingWeapon != NULL) firingWeapon->fire();
     104    }
     105}
     106
     107
    93108/**
    94109   \brief standard constructor
Note: See TracChangeset for help on using the changeset viewer.