- fixed playback on the wrong sound channel.

This commit is contained in:
Christoph Oelckers 2019-12-19 09:29:23 +01:00
parent 92c8e4c110
commit e348fcb843

View file

@ -558,7 +558,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
*pos = npos; *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. // For unpanned sounds the volume must be set directly and the position taken from the listener.
*pos = campos; *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); auto rolloff = GetRolloff(vp->voc_distance);
FVector3 spos = pos ? GetSoundPos(pos) : FVector3(0, 0, 0); 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; return 1;
} }