From 6cb22fb04d83e0bc1046dd980736d97768928725 Mon Sep 17 00:00:00 2001 From: RblSb Date: Sun, 29 Aug 2021 22:08:50 +0300 Subject: Fix int32 overflow closes #29 --- src/server/Utils.hx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server/Utils.hx') diff --git a/src/server/Utils.hx b/src/server/Utils.hx index 9aa0d66..a2f4382 100644 --- a/src/server/Utils.hx +++ b/src/server/Utils.hx @@ -69,6 +69,10 @@ class Utils { return "127.0.0.1"; } + public static function isOutOfRange(value:Float, min:Float, max:Float):Bool { + return value == null || Math.isNaN(value) || value < min || value > max; + } + public static function sortedPush(ids:Array, id:Int):Void { for (i => n in ids) { if (id < n) { -- cgit v1.2.3