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 Jun 1, 2024
1 parent 3195c33 commit 3d6856c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xrGame/WeaponMagazined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ 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);
if (WeaponSoundExist(section, "snd_silncer_shot_actor"))
m_layered_sounds.LoadSound(section, "snd_silncer_shot_actor", "sndSilencerShotActor", false, m_eSoundShot);
//-Alundaio
Expand Down Expand Up @@ -1065,7 +1066,9 @@ void CWeaponMagazined::InitAddons()
}
}

if (IsSilencerAttached() /* && SilencerAttachable() */)
if (IsSilencerAttached() && pSettings->line_exist(*cNameSect(), "silencer_flame_particles")
&& pSettings->line_exist(*cNameSect(), "silencer_light_color")
&& pSettings->line_exist(*cNameSect(), "silencer_smoke_particles"))
{
m_sFlameParticlesCurrent = m_sSilencerFlameParticles;
m_sSmokeParticlesCurrent = m_sSilencerSmokeParticles;
Expand Down

0 comments on commit 3d6856c

Please sign in to comment.