From 281533e82d467231a08262f460b032ee253f1371 Mon Sep 17 00:00:00 2001 From: thebigMuh Date: Fri, 23 Apr 2021 22:58:48 +0200 Subject: [PATCH] This fixes exclusively the panning bug, where after a certain distance is exceeded, sound samples get played without panning. --- Source/utils/soundsample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/utils/soundsample.cpp b/Source/utils/soundsample.cpp index 98e2e43fb..203e9868e 100644 --- a/Source/utils/soundsample.cpp +++ b/Source/utils/soundsample.cpp @@ -54,7 +54,7 @@ void SoundSample::Play(int lVolume, int lPan, int channel) Mix_Volume(channel, pow((double)10, (double)lVolume / 2000.0) * MIX_MAX_VOLUME); int pan = copysign(pow((double)10, -abs(lPan) / 2000.0) * 255, (double)lPan); - Mix_SetPanning(channel, pan > 0 ? pan : 255, pan < 0 ? abs(pan) : 255); + Mix_SetPanning(channel, lPan > 0 ? pan : 255, lPan < 0 ? abs(pan) : 255); }; /**