diff options
Diffstat (limited to 'npc/functions/math.txt')
-rw-r--r-- | npc/functions/math.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/npc/functions/math.txt b/npc/functions/math.txt index fc27bec40..22cf88159 100644 --- a/npc/functions/math.txt +++ b/npc/functions/math.txt @@ -79,6 +79,16 @@ function script is_between { } +// result is: lower < target <= higher +// is_between ( lower, target, higher) +function script is_between2 { + .@min=getarg(0); + .@val=getarg(1); + .@max=getarg(2); + return (.@min < .@val && .@val <= .@max); +} + + // forces the equation: lower <= target <= higher. // Note it still works if higher and target values are swapped. // limit ( lower, target, higher) |