diff --git a/code/__defines/math.dm b/code/__defines/math.dm index a93291afa1..d59180bbfa 100644 --- a/code/__defines/math.dm +++ b/code/__defines/math.dm @@ -9,8 +9,6 @@ #define SHORT_REAL_LIMIT 16777216 -#define CLAMP01(x) clamp(x, 0, 1) - #define TAN(x) tan(x) #define ATAN2(x, y) arctan(x, y) diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 451b8273c8..a25de730a3 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -189,7 +189,7 @@ ); // This is the define used to calculate falloff. -#define LUM_FALLOFF(C, T)(1 - CLAMP01(((C.x - T.x) ** 2 +(C.y - T.y) ** 2 + LIGHTING_HEIGHT) ** 0.6 / max(1, light_range))) +#define LUM_FALLOFF(C, T)(1 - clamp(((C.x - T.x) ** 2 +(C.y - T.y) ** 2 + LIGHTING_HEIGHT) ** 0.6 / max(1, light_range), 0, 1)) /datum/light_source/proc/apply_lum() var/static/update_gen = 1 diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index bc3c099091..dcd8b902af 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -54,7 +54,7 @@ totallums =(totallums - minlum) /(maxlum - minlum) - return CLAMP01(totallums) + return clamp(totallums, 0, 1) // Can't think of a good name, this proc will recalculate the has_opaque_atom variable. /turf/proc/recalc_atom_opacity()