Skip to content

Commit

Permalink
-Blood: fix crashes when trying to exit from a fatal error during sta…
Browse files Browse the repository at this point in the history
…rtup.

soundEngine can be null here.
  • Loading branch information
coelckers committed Feb 20, 2022
1 parent 7897945 commit b6eadbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/games/blood/src/sfx.cpp
Expand Up @@ -265,7 +265,7 @@ void sfxKill3DSound(DBloodActor* pActor, int a2, int a3)

void sfxKillAllSounds(void)
{
soundEngine->EnumerateChannels([](FSoundChan* channel)
if (soundEngine) soundEngine->EnumerateChannels([](FSoundChan* channel)
{
if (channel->SourceType == SOURCE_Actor || channel->SourceType == SOURCE_Unattached) soundEngine->StopChannel(channel);
return false;
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/sound.cpp
Expand Up @@ -218,7 +218,7 @@ void sndStartWavDisk(const char* pzFile, int nVolume, int nChannel)

void sndKillAllSounds(void)
{
soundEngine->StopSound(CHAN_AUTO);
if (soundEngine) soundEngine->StopSound(CHAN_AUTO);
}


Expand Down

0 comments on commit b6eadbc

Please sign in to comment.