Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10438 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jan 28, 2007, 1:36:22 PM (18 years ago)
Author:
patrick
Message:

switch completed

Location:
trunk/src/world_entities/weapons
Files:
2 edited

Legend:

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

    r10437 r10438  
    316316  weapon->setAmmoContainer(this->getAmmoContainer(weapon->getProjectileType()));
    317317  if(configID == this->currentConfigID)
    318     this->currentSlotConfig[slotID]->nextWeapon = weapon;
     318    this->currentSlotConfig[slotID]->setNextWeapon(weapon);
    319319  //if (this->parent != NULL)
    320320  {
     
    425425
    426426  for (int i = 0; i < WM_MAX_SLOTS; i++)
    427     this->currentSlotConfig[i]->nextWeapon = this->configs[currentConfigID][i];
     427    this->currentSlotConfig[i]->setNextWeapon(this->configs[currentConfigID][i]);
    428428}
    429429
     
    458458  for(int i = 0; i < this->slotCount; i++)
    459459  {
    460     firingWeapon = this->currentSlotConfig[i]->currentWeapon;
     460    firingWeapon = this->currentSlotConfig[i]->getCurrentWeapon();
    461461    if( firingWeapon != NULL) firingWeapon->requestAction(WA_NONE);
    462462  }
     
    485485
    486486    // current Weapon in Slot i
    487     tickWeapon = this->currentSlotConfig[i]->currentWeapon;
     487    tickWeapon = this->currentSlotConfig[i]->getCurrentWeapon();
    488488    // On A change (current != next)
    489     if (tickWeapon != this->currentSlotConfig[i]->nextWeapon)
     489    if (tickWeapon != this->currentSlotConfig[i]->getNextWeapon())
    490490    {
    491491      // if a Weapon is Active in slot i, deactivate it.
     
    500500        {
    501501          tickWeapon->toList(OM_NULL);
    502           this->currentSlotConfig[i]->currentWeapon = NULL;
     502          this->currentSlotConfig[i]->setCurrentWeapon(NULL);
    503503        }
    504504      }
    505505      // switching to next Weapon
    506       tickWeapon = this->currentSlotConfig[i]->currentWeapon = this->currentSlotConfig[i]->nextWeapon;
     506      this->currentSlotConfig[i]->setCurrentWeapon(this->currentSlotConfig[i]->getNextWeapon());
     507      tickWeapon = this->currentSlotConfig[i]->getCurrentWeapon();
    507508
    508509      if (tickWeapon != NULL)
     
    520521    }
    521522    else if (unlikely(tickWeapon != NULL && tickWeapon->getCurrentState() == WS_DEACTIVATING))
    522       this->currentSlotConfig[i]->nextWeapon = NULL;
     523      this->currentSlotConfig[i]->setNextWeapon(NULL);
    523524  }
    524525}
     
    534535  for (int i = 0; i < this->slotCount; i++)
    535536  {
    536     drawWeapon = this->currentSlotConfig[i]->currentWeapon;
     537    drawWeapon = this->currentSlotConfig[i]->getCurrentWeapon();
    537538    if( drawWeapon != NULL && drawWeapon->isVisible())
    538539      drawWeapon->draw();
  • trunk/src/world_entities/weapons/weapon_slot.h

    r10437 r10438  
    3333  inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; }
    3434
    35 //   private:
     35private:
    3636
    3737  long          capability;             //!< the capabilities of the Slot @see WeaponSlotCapability.
Note: See TracChangeset for help on using the changeset viewer.