mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Don't try to calculate sound falloff at or below the minimum distance. (#25628)
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user