Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2009, 5:05:18 PM (16 years ago)
Author:
polakma
Message:

now you can choose between shared munition and normal munition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weaponsystem/src/orxonox/objects/weaponSystem/WeaponSet.cc

    r2662 r2778  
    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
    6762            //should be possible to choose which slot to use
     63
     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) );
Note: See TracChangeset for help on using the changeset viewer.