diff --git a/data/magic.mse-game/script b/data/magic.mse-game/script index 041942e7c..ea2b33e3a 100644 --- a/data/magic.mse-game/script +++ b/data/magic.mse-game/script @@ -97,9 +97,14 @@ clamp := { else if number > maximum then maximum else number } -round_up := {to_int(0.99999999999998+input)} #### 0.99999999999999 == 1, leave the 8 -round_near := {to_int(0.5+input)} to_number_lax := { to_number(input) or else to_number(trim(input)) or else 0 } +round_near := { if input < 0 then to_int(input-0.5) else to_int(input+0.5) } +#### 0.99999999999999 == 1, leave the 8 +round_up := { + if input < 0 + then to_int(input-0.99999999999998) + else to_int(input+0.99999999999998) +} #### type_name("string") returns string ("string") so fix that #### type_name(nil) is fine