From f4f92843e5c72bf7022495f44495b013f17076c4 Mon Sep 17 00:00:00 2001 From: Krzysztof Sobiecki Date: Mon, 20 May 2024 20:39:38 +0200 Subject: [PATCH] Clear Sky: Crash when some weapons(eg. wpn_val) with built in suppressor don't have snd_silncer_shot only snd_shoot --- src/xrGame/WeaponMagazined.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/xrGame/WeaponMagazined.cpp b/src/xrGame/WeaponMagazined.cpp index a6bad977fab..b417c41762f 100644 --- a/src/xrGame/WeaponMagazined.cpp +++ b/src/xrGame/WeaponMagazined.cpp @@ -98,7 +98,15 @@ void CWeaponMagazined::Load(LPCSTR section) m_sSilencerSmokeParticles = pSettings->r_string(section, "silencer_smoke_particles"); //Alundaio: LAYERED_SND_SHOOT Silencer - m_layered_sounds.LoadSound(section, "snd_silncer_shot", "sndSilencerShot", false, m_eSoundShot); + if (WeaponSoundExist(section, "snd_silncer_shot")) + { + m_layered_sounds.LoadSound(section, "snd_silncer_shot", "sndSilencerShot", false, m_eSoundShot); + } + else + { + m_layered_sounds.LoadSound(section, "snd_shoot", "sndSilencerShot", false, m_eSoundShot); + } + if (WeaponSoundExist(section, "snd_silncer_shot_actor")) m_layered_sounds.LoadSound(section, "snd_silncer_shot_actor", "sndSilencerShotActor", false, m_eSoundShot); //-Alundaio