From 2e94b61dff84886bdc30378a2e3a546c3a028dbe Mon Sep 17 00:00:00 2001 From: sorucoder <40341154+sorucoder@users.noreply.github.com> Date: Sun, 9 Dec 2018 01:04:24 -0500 Subject: [PATCH] Fixed util.randomFloat Fixed if both max or min is nil, it returns a number between 0 and 1 --- sys/apis/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/apis/util.lua b/sys/apis/util.lua index cc59848..b77d444 100644 --- a/sys/apis/util.lua +++ b/sys/apis/util.lua @@ -137,7 +137,7 @@ end function Util.randomFloat(max, min) min = min or 0 - max = max or 0 + max = max or 1 return (max-min) * math.random() + min end