From d941fc3f0b062b3485ad2f94c4d6edbdc7f45aab Mon Sep 17 00:00:00 2001 From: Bobbyperson Date: Mon, 18 Nov 2024 17:48:43 -0500 Subject: Fix client crash during final killcam (#900) By adding a sanity check to see if the passed string is empty or not. --- Northstar.Client/mod/scripts/vscripts/client/cl_screenfade.gnut | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Northstar.Client/mod/scripts/vscripts/client/cl_screenfade.gnut b/Northstar.Client/mod/scripts/vscripts/client/cl_screenfade.gnut index 9844b65b..deccbac2 100644 --- a/Northstar.Client/mod/scripts/vscripts/client/cl_screenfade.gnut +++ b/Northstar.Client/mod/scripts/vscripts/client/cl_screenfade.gnut @@ -247,8 +247,10 @@ void function PlayerPainSoundThread() ourPlayer = localViewPlayer; soundLayer2Start = GetPainSound( ourPlayer, "sound_pain_layer2_start" ) soundLayer2Loop = GetPainSound( ourPlayer, "sound_pain_layer2_loop" ) - EmitSoundOnEntity( ourPlayer, soundLayer2Start ) - EmitSoundOnEntity( ourPlayer, soundLayer2Loop ) + if ( soundLayer2Start != "" ) + EmitSoundOnEntity( ourPlayer, soundLayer2Start ) + if ( soundLayer2Loop != "" ) + EmitSoundOnEntity( ourPlayer, soundLayer2Loop ) } else { @@ -274,7 +276,8 @@ void function PlayerPainSoundThread() ourPlayer = localViewPlayer soundLayer3Loop = GetPainSound( ourPlayer, "sound_pain_layer3_loop" ) soundLayer3End = GetPainSound( ourPlayer, "sound_pain_layer3_end" ) - EmitSoundOnEntity( ourPlayer, soundLayer3Loop ) + if ( soundLayer3Loop != "" ) + EmitSoundOnEntity( ourPlayer, soundLayer3Loop ) } else { -- cgit v1.2.3