- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSet.cc
r2662 r2907 56 56 void WeaponSet::attachWeaponPack(WeaponPack *wPack) 57 57 { 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;62 58 if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) ) 63 59 { 64 //COUT(0) << "WeaponSet::attachWeaponPack after if" << std::endl;65 60 this->attachedWeaponPack_ = wPack; 66 61 int wPackWeapon = 0; //WeaponCounter for Attaching 62 67 63 //should be possible to choose which slot to use 64 //attach every weapon of the weaponPack to a weaponSlot 68 65 for ( int i=0; i < wPack->getSize() ; i++ ) 69 66 { 70 67 //at the moment this function only works for one weaponPack in the entire WeaponSystem... 68 //it also takes the first free weaponSlot... 71 69 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full 72 70 { 73 //COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl;74 71 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) ); 75 72 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); … … 83 80 if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 ) 84 81 { 85 //COUT(0) << "WeaponSet::attachWeaponPack mode 2 k="<< k << std::endl;86 82 this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) ); 87 83 this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) ); … … 99 95 { 100 96 //fires all WeaponSlots available for this weaponSet attached from the WeaponPack 101 //COUT(0) << "WeaponSet::fire from Pack: " << this->attachedWeaponPack_ << std::endl;102 97 if (this->attachedWeaponPack_) 103 98 this->attachedWeaponPack_->fire();
Note: See TracChangeset
for help on using the changeset viewer.