Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 9:20:39 PM (15 years ago)
Author:
polakma
Message:

altfire now available

File:
1 edited

Legend:

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

    r2391 r2398  
    6868            {
    6969                //at the moment this function only works for one weaponPack in the entire WeaponSystem...
    70                 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 ) //if slot not full
     70                if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full
    7171                {
     72COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl;
    7273                    this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) );
    7374                    this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
    7475                    wPackWeapon++;
     76                }
     77                else
     78                {
     79                    for (int k=0; k < this->parentWeaponSystem_->getWeaponSlotSize(); k++)
     80                    {
     81                        if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 )
     82                        {
     83COUT(0) << "WeaponSet::attachWeaponPack mode 2 k="<< k << std::endl;
     84                            this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) );
     85                            this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
     86                            wPackWeapon++;
     87                        }
     88                    }
    7589                }
    7690            }
Note: See TracChangeset for help on using the changeset viewer.