Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 5, 2009, 11:27:54 PM (15 years ago)
Author:
landauf
Message:

merged weaponsystem branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.cc

    r2662 r2893  
    5656    void WeaponSet::attachWeaponPack(WeaponPack *wPack)
    5757    {
    58 //COUT(0) << "WeaponSet::attachWeaponPack" << std::endl;
    59 //COUT(0) << "........ parentWeaponSystem_=" << this->parentWeaponSystem_ << std::endl;
    60 //COUT(0) << "........ this->parentWeaponSystem_->getWeaponSlotSize()" << this->parentWeaponSystem_->getWeaponSlotSize() << std::endl;
    61 //COUT(0) << "........ wPack->getSize()" << wPack->getSize() << std::endl;
    6258        if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) )
    6359        {
    64 //COUT(0) << "WeaponSet::attachWeaponPack after if" << std::endl;
    6560            this->attachedWeaponPack_ = wPack;
    6661            int wPackWeapon = 0;    //WeaponCounter for Attaching
     62           
    6763            //should be possible to choose which slot to use
     64            //attach every weapon of the weaponPack to a weaponSlot
    6865            for (  int i=0; i < wPack->getSize() ; i++  )
    6966            {
    7067                //at the moment this function only works for one weaponPack in the entire WeaponSystem...
     68                //it also takes the first free weaponSlot...
    7169                if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full
    7270                {
    73 //COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl;
    7471                    this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) );
    7572                    this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
     
    8380                        if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 )
    8481                        {
    85 //COUT(0) << "WeaponSet::attachWeaponPack mode 2 k="<< k << std::endl;
    8682                            this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) );
    8783                            this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
     
    9995    {
    10096        //fires all WeaponSlots available for this weaponSet attached from the WeaponPack
    101 //COUT(0) << "WeaponSet::fire from Pack: " << this->attachedWeaponPack_ << std::endl;
    10297        if (this->attachedWeaponPack_)
    10398            this->attachedWeaponPack_->fire();
Note: See TracChangeset for help on using the changeset viewer.