-Blood: fix crashes when trying to exit from a fatal error during startup.

soundEngine can be null here.
This commit is contained in:
Christoph Oelckers 2022-02-21 00:26:51 +01:00
parent 789794539c
commit b6eadbccb5
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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);
}