Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 24, 2005, 3:11:36 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: new Definitions in the WeaponManager-class

File:
1 edited

Legend:

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

    r4926 r4949  
    4040}
    4141
     42WeaponManager::WeaponManager(const TiXmlElement* root)
     43{
     44  this->init();
     45  this->loadParams(root);
     46}
    4247
    4348/**
     
    5156  world will clean them up for me
    5257  */
    53   for(int i = 0; i < W_MAX_CONFIGS; ++i)
     58  for(int i = 0; i < WM_MAX_CONFIGS; ++i)
    5459  {
    5560    this->configs[i].bUsed = false;
    56     for(int j = 0; j < W_MAX_SLOTS; ++j)
     61    for(int j = 0; j < WM_MAX_SLOTS; ++j)
    5762      this->configs[i].slots[j] = NULL;
    5863  }
     
    6974  this->setClassID(CL_WEAPON_MANAGER, "WeaponManager");
    7075
    71   for(int i = 0; i < W_MAX_CONFIGS; ++i)
     76  for(int i = 0; i < WM_MAX_CONFIGS; ++i)
    7277  {
    7378    this->configs[i].bUsed = false;
    74     for(int j = 0; j < W_MAX_SLOTS; ++j)
     79    for(int j = 0; j < WM_MAX_SLOTS; ++j)
    7580      this->configs[i].slots[j] = NULL;
    7681  }
     
    186191  int i, lastConfID;
    187192  lastConfID = this->currConfID;
    188   for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
    189   if( i == W_MAX_CONFIGS) this->currConfID = WM_CONFIG0;
     193  for(i = this->currConfID + 1; i < WM_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
     194  if( i == WM_MAX_CONFIGS) this->currConfID = WM_CONFIG0;
    190195  else this->currConfID = i;
    191196
    192197
    193198  Weapon *w1, *w2;
    194   for(int j = 0; j < W_MAX_SLOTS; ++j)
     199  for(int j = 0; j < WM_MAX_SLOTS; ++j)
    195200  {
    196201    w1 = this->configs[lastConfID].slots[j];
     
    224229{
    225230  Weapon* firingWeapon;
    226   for(int i = 0; i < W_MAX_SLOTS; ++i)
     231  for(int i = 0; i < WM_MAX_SLOTS; ++i)
    227232  {
    228233    firingWeapon = this->configs[this->currConfID].slots[i];
     
    241246{
    242247  Weapon* w;
    243   for(int i = 0; i < W_MAX_SLOTS; ++i)
     248  for(int i = 0; i < WM_MAX_SLOTS; ++i)
    244249  {
    245250    w = this->configs[this->currConfID].slots[i];
     
    259264  Weapon* w;
    260265  for (int j = 0; j < 4; ++j )
    261   for(int i = 0; i < W_MAX_SLOTS; ++i)
     266  for(int i = 0; i < WM_MAX_SLOTS; ++i)
    262267  {
    263268    w = this->configs[j].slots[i];
     
    274279int WeaponManager::getNextFreeSlot(int configID)
    275280{
    276   for( int i = 0; i < W_MAX_SLOTS; ++i)
     281  for( int i = 0; i < WM_MAX_SLOTS; ++i)
    277282  {
    278283    if( this->configs[configID].slots[i] == NULL)
Note: See TracChangeset for help on using the changeset viewer.