- Timestamp:
- Dec 7, 2009, 2:23:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
r6245 r6265 39 39 #include "WeaponPack.h" 40 40 #include "WeaponSystem.h" 41 #include "WeaponSlot.h" 41 42 42 43 #include "sound/WorldSound.h" … … 72 73 this->defSndWpnFire_ = new WorldSound(this); 73 74 this->defSndWpnFire_->setLooping(false); 75 this->bSoundAttached_ = false; 74 76 } 75 77 … … 104 106 { 105 107 (*reloadTime) = this->reloadTime_; 108 if( !this->bSoundAttached_ ) 109 { 110 assert(this->getWeapon() && this->getWeapon()->getWeaponSlot()); 111 this->getWeapon()->getWeaponSlot()->attach(this->defSndWpnFire_); 112 this->bSoundAttached_ = true; 113 } 106 114 107 115 if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this)) … … 122 130 this->reloadTimer_.startTimer(); 123 131 124 assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );125 this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->attach(this->defSndWpnFire_);126 132 if(!(this->defSndWpnFire_->isPlaying())) 127 133 {
Note: See TracChangeset
for help on using the changeset viewer.