Skip to content

Commit

Permalink
Clear Sky: Crash when some weapons(eg. wpn_val) with built in suppres…
Browse files Browse the repository at this point in the history
…sor don't have snd_silncer_shot only snd_shoot
  • Loading branch information
sobkas committed May 21, 2024
1 parent f3383c2 commit 4295c9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xrGame/WeaponMagazined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void CWeaponMagazined::Load(LPCSTR section)
m_sSndShotCurrent = "sndShot";

//звуки и партиклы глушителя, если такой есть
if (m_eSilencerStatus == ALife::eAddonAttachable || m_eSilencerStatus == ALife::eAddonPermanent)
if ((m_eSilencerStatus == ALife::eAddonAttachable || m_eSilencerStatus == ALife::eAddonPermanent) && WeaponSoundExist(section, "snd_silncer_shot"))
{
if (pSettings->line_exist(section, "silencer_flame_particles"))
m_sSilencerFlameParticles = pSettings->r_string(section, "silencer_flame_particles");
Expand Down Expand Up @@ -1065,7 +1065,7 @@ void CWeaponMagazined::InitAddons()
}
}

if (IsSilencerAttached() /* && SilencerAttachable() */)
if (IsSilencerAttached() && WeaponSoundExist(cNameSect().c_str(), "snd_silncer_shot"))
{
m_sFlameParticlesCurrent = m_sSilencerFlameParticles;
m_sSmokeParticlesCurrent = m_sSilencerSmokeParticles;
Expand Down

0 comments on commit 4295c9d

Please sign in to comment.