Don't try to calculate sound falloff at or below the minimum distance. (#25628)

This commit is contained in:
Charlie Nolan
2024-05-30 15:15:14 +00:00
committed by GitHub
parent 2074267a46
commit d3974ee77b
+1 -1
View File
@@ -106,7 +106,7 @@ falloff_distance - Distance at which falloff begins. Sound is at peak volume (in
distance *= distance_multiplier
if(max_distance) //If theres no max_distance we're not a 3D sound, so no falloff.
if(max_distance && distance > falloff_distance) //If theres no max_distance we're not a 3D sound, so no falloff.
S.volume -= (max(distance - falloff_distance, 0) ** (1 / falloff_exponent)) / ((max(max_distance, distance) - falloff_distance) ** (1 / falloff_exponent)) * S.volume
//https://www.desmos.com/calculator/sqdfl8ipgf