From e348fcb843503c022da66da8e19b3608ca1eb9a9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 19 Dec 2019 09:29:23 +0100 Subject: [PATCH] - fixed playback on the wrong sound channel. --- source/sw/src/sounds.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index 5fabbdcaf..0e86bec25 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -558,7 +558,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], *pos = npos; } - if (chanflags & CHANEXF_DONTPAN) + if (vpos && chanflags & CHANEXF_DONTPAN) { // For unpanned sounds the volume must be set directly and the position taken from the listener. *pos = campos; @@ -668,7 +668,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); - soundEngine->StartSound(sourcetype, source, &spos, CHAN_BODY, cflags, num, 1.f, ATTN_NORM, &rolloff, S_ConvertPitch(pitch)); + soundEngine->StartSound(sourcetype, source, &spos, channel, cflags, num, 1.f, ATTN_NORM, &rolloff, S_ConvertPitch(pitch)); return 1; }