mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 23:52:12 +00:00
NTSL2++ sucessor to NTSL2+ (#9321)
This drastcly is meant to rework DM and Daemon code to allow further expansion and replacement of custom engine with JavaScript language based engine. Daemon PR - Aurorastation/ByondInterpretedLanguage#7 Forums topic for discussion - https://forums.aurorastation.org/topic/14570-ntsl2-and-its-future/ Superseeds #8817
This commit is contained in:
@@ -213,37 +213,7 @@ proc/n_abs(var/num)
|
||||
if(isnum(num))
|
||||
return abs(num)
|
||||
|
||||
// Round down
|
||||
proc/n_floor(var/num)
|
||||
if(isnum(num))
|
||||
return round(num)
|
||||
|
||||
// Round up
|
||||
proc/n_ceil(var/num)
|
||||
if(isnum(num))
|
||||
return round(num)+1
|
||||
|
||||
// Round to nearest integer
|
||||
proc/n_round(var/num)
|
||||
if(isnum(num))
|
||||
if(num-round(num)<0.5)
|
||||
return round(num)
|
||||
return n_ceil(num)
|
||||
|
||||
// Clamps N between min and max
|
||||
proc/n_clamp(var/num, var/min=-1, var/max=1)
|
||||
if(isnum(num)&&isnum(min)&&isnum(max))
|
||||
if(num<=min)
|
||||
return min
|
||||
if(num>=max)
|
||||
return max
|
||||
return num
|
||||
|
||||
// Returns 1 if N is inbetween Min and Max
|
||||
proc/n_inrange(var/num, var/min=-1, var/max=1)
|
||||
if(isnum(num)&&isnum(min)&&isnum(max))
|
||||
return ((min <= num) && (num <= max))
|
||||
// END OF BY DONKIE :(
|
||||
|
||||
// Non-recursive
|
||||
// Imported from Mono string.ReplaceUnchecked
|
||||
|
||||
Reference in New Issue
Block a user