- Timestamp:
- Feb 4, 2016, 11:54:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.cc
r11099 r11108 52 52 this->spread_ = 0.2f; 53 53 this->damageReduction_ = 1.0f; 54 this->splitSound_ = nullptr; 55 56 this->setSplitSound("sounds/Weapon_SplitGun.ogg", 0.8); 57 } 58 59 SplitGunProjectile::~SplitGunProjectile() 60 { 61 if (this->isInitialized()) 62 { 63 if (splitSound_) 64 { 65 splitSound_->destroy(); 66 } 67 } 54 68 } 55 69 … … 158 172 159 173 numberOfSplits_ = 0; 174 175 if (splitSound_) 176 { 177 splitSound_->play(); 178 } 160 179 } 161 180 } 181 182 void SplitGunProjectile::setSplitSound(const std::string& soundPath, const float soundVolume) 183 { 184 if (!splitSound_) 185 { 186 this->splitSound_ = new WorldSound(this->getContext()); 187 this->splitSound_->setLooping(false); 188 this->attach(splitSound_); 189 } 190 191 this->splitSound_->setSource(soundPath); 192 this->splitSound_->setVolume(soundVolume); 193 } 162 194 }
Note: See TracChangeset
for help on using the changeset viewer.