- Timestamp:
- Dec 3, 2008, 3:11:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc
r2308 r2319 53 53 void WeaponSet::attachWeaponPack(WeaponPack *wPack) 54 54 { 55 if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) )55 if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) ) 56 56 { 57 57 this->attachedWeaponPack_ = wPack; 58 int wPackWeapon = 0; //WeaponCounter for Attaching 58 59 //should be possible to choose which slot to use 59 60 for ( int i=0; i < wPack->getSize() ; i++ ) 60 61 { 61 62 //at the moment this function only works for one weaponPack in the entire WeaponSystem... 62 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) ); 63 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(i) ); 63 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() != 0 ) //if slot not full 64 { 65 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) ); 66 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); 67 wPackWeapon++; 68 } 64 69 } 65 70 }
Note: See TracChangeset
for help on using the changeset viewer.