From 2067d9474db55f2be47f54969edc2d63a0ea57e5 Mon Sep 17 00:00:00 2001 From: ike709 Date: Tue, 11 Feb 2025 13:21:20 -0600 Subject: [PATCH] Use native `sign()` in BYOND 516 (#20452) https://www.byond.com/docs/ref/#/proc/sign BYOND 516 adds `sign()` as a built-in proc. Signed-off-by: ike709 --- code/__HELPERS/unsorted.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 42a3b95a687..44e7a65e7d0 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -227,8 +227,10 @@ Turf and target are seperate in case you want to teleport some distance from a t return 1 return 0 +#if DM_VERSION < 516 /proc/sign(x) return x!=0?x/abs(x):0 +#endif /proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm var/px=M.x //starting x