From 2e8ace603b49e30694f1b3b5f3c973da4429f014 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 1 Mar 2020 13:10:07 +0100 Subject: [PATCH] - fixed SW sound crash. --- source/sw/src/sounds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index ff8d1505a..e180a82c3 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -671,7 +671,7 @@ int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t* pos, Voc3D_Flags flags, auto rolloff = GetRolloff(vp->voc_distance); FVector3 spos = pos ? GetSoundPos(pos) : FVector3(0, 0, 0); auto chan = soundEngine->StartSound(sourcetype, source, &spos, channel, cflags, num, 1.f, ATTN_NORM, &rolloff, S_ConvertPitch(pitch)); - if (sourcetype == SOURCE_Unattached) chan->Source = sps; // needed for sound termination. + if (chan && sourcetype == SOURCE_Unattached) chan->Source = sps; // needed for sound termination. return 1; }