Prevent effectiveDist from going negative

This commit is contained in:
Chris Robinson 2010-09-11 23:57:15 -07:00
parent 1a2883ae9a
commit 8953a73fb1

View File

@ -428,7 +428,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
WetGain[i] = SourceVolume * RoomAttenuation[i];
effectiveDist = 0.0f;
if(MinDist > 0.0f)
if(MinDist > 0.0f && flAttenuation < 1.0f)
effectiveDist = (MinDist/flAttenuation - MinDist)*MetersPerUnit;
// Distance-based air absorption