aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d54b9f09..1299e98c 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -396,12 +396,15 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
break;
//fall-through
case AL_LINEAR_DISTANCE:
- Distance=__min(Distance,MaxDist);
if(MaxDist != MinDist)
{
flAttenuation = 1.0f - (Rolloff*(Distance-MinDist)/(MaxDist - MinDist));
+ flAttenuation = __max(flAttenuation, 0.0f);
for(i = 0;i < NumSends;i++)
+ {
RoomAttenuation[i] = 1.0f - (RoomRolloff[i]*(Distance-MinDist)/(MaxDist - MinDist));
+ RoomAttenuation[i] = __max(RoomAttenuation[i], 0.0f);
+ }
}
break;