Skip to content

Commit

Permalink
Fix client crash during final killcam (R2Northstar#900)
Browse files Browse the repository at this point in the history
By adding a sanity check to see if the passed string is empty or not.
  • Loading branch information
Bobbyperson authored Nov 18, 2024
1 parent 0528f9f commit d941fc3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down

0 comments on commit d941fc3

Please sign in to comment.