- Timestamp:
- Dec 10, 2008, 9:20:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc
r2391 r2398 68 68 { 69 69 //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 full70 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full 71 71 { 72 COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl; 72 73 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) ); 73 74 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); 74 75 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 { 83 COUT(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 } 75 89 } 76 90 }
Note: See TracChangeset
for help on using the changeset viewer.