diff --git a/code/__defines/__513_compatibility.dm b/code/__defines/__513_compatibility.dm new file mode 100644 index 0000000000..7f8d7eb4e6 --- /dev/null +++ b/code/__defines/__513_compatibility.dm @@ -0,0 +1,31 @@ +#if DM_VERSION < 513 + +#define ismovableatom(A) (istype(A, /atom/movable)) + +#define islist(L) (istype(L, /list)) + +#define CLAMP01(x) (CLAMP(x, 0, 1)) + +#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) ) + +#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) ) + +#define TAN(x) (sin(x) / cos(x)) + +#define arctan(x) (arcsin(x/sqrt(1+x*x))) + +////////////////////////////////////////////////// + +#else + +#define ismovableatom(A) ismovable(A) + +#define CLAMP01(x) clamp(x, 0, 1) + +#define CLAMP(CLVALUE, CLMIN, CLMAX) clamp(CLVALUE, CLMIN, CLMAX) + +#define TAN(x) tan(x) + +#define ATAN2(x, y) arctan(x, y) + +#endif \ No newline at end of file diff --git a/code/__defines/is_helpers.dm b/code/__defines/is_helpers.dm index ed4a0dd10f..d3222965a9 100644 --- a/code/__defines/is_helpers.dm +++ b/code/__defines/is_helpers.dm @@ -2,7 +2,7 @@ #define isdatum(D) istype(D, /datum) #define isweakref(A) istype(A, /weakref) -#define islist(D) istype(D, /list) +//#define islist(D) istype(D, /list) //Built in //--------------- #define isatom(D) istype(D, /atom) diff --git a/code/__defines/math.dm b/code/__defines/math.dm index 88c459ba78..2053b762d2 100644 --- a/code/__defines/math.dm +++ b/code/__defines/math.dm @@ -16,7 +16,6 @@ #define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(world.tick_usage - starting_tickusage)) #define PERCENT(val) (round((val)*100, 0.1)) -#define CLAMP01(x) (CLAMP(x, 0, 1)) //time of day but automatically adjusts to the server going into the next day within the same round. //for when you need a reliable time number that doesn't depend on byond time. @@ -30,17 +29,12 @@ // round() acts like floor(x, 1) by default but can't handle other values #define FLOOR(x, y) ( round((x) / (y)) * (y) ) -#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) ) - // Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive #define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ) // Real modulus that handles decimals #define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) ) -// Tangent -#define TAN(x) (sin(x) / cos(x)) - // Cotangent #define COT(x) (1 / TAN(x)) @@ -50,8 +44,6 @@ // Cosecant #define CSC(x) (1 / sin(x)) -#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) ) - // Greatest Common Divisor - Euclid's algorithm /proc/GCD(a, b) return b ? GCD(b, (a) % (b)) : a diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index d85c33a4e5..44c62a506b 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -587,10 +587,6 @@ Turf and target are seperate in case you want to teleport some distance from a t /proc/between(var/low, var/middle, var/high) return max(min(middle, high), low) -proc/arctan(x) - var/y=arcsin(x/sqrt(1+x*x)) - return y - //returns random gauss number proc/GaussRand(var/sigma) var/x,y,rsq diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 433dfae84e..bd4317787a 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1032,7 +1032,7 @@ Note that amputating the affected organ does in fact remove the infection from t W.germ_level = 0 return rval -/obj/item/organ/external/proc/clamp() +/obj/item/organ/external/proc/organ_clamp() var/rval = 0 src.status &= ~ORGAN_BLEEDING for(var/datum/wound/W in wounds) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index 64de0aeef4..02003dd950 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -102,7 +102,7 @@ affected.open = 1 affected.createwound(CUT, 1) - affected.clamp() + affected.organ_clamp() spread_germs_to_organ(affected, user) /datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -148,7 +148,7 @@ affected.status |= ORGAN_BLEEDING affected.createwound(CUT, 1) - affected.clamp() + affected.organ_clamp() affected.open = 2 /datum/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -188,7 +188,7 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \ "You clamp bleeders in [target]'s [affected.name] with \the [tool].") - affected.clamp() + affected.organ_clamp() spread_germs_to_organ(affected, user) /datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/vorestation.dme b/vorestation.dme index b3512e4b94..cb87f51feb 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -23,6 +23,7 @@ #include "code\stylesheet.dm" #include "code\world.dm" #include "code\__datastructures\globals.dm" +#include "code\__defines\__513_compatibility.dm" #include "code\__defines\_compile_options.dm" #include "code\__defines\_lists.dm" #include "code\__defines\_planes+layers.dm"