mirror of
https://github.com/kepler155c/opus
synced 2025-01-13 09:00:27 +00:00
Removed util.random, added util.randomFloat
Removed util.random as it is a duplicate of math.random. Added util.randomFloat, which returns a random floating point number.
This commit is contained in:
parent
3c9f03477a
commit
3f3a2deaa8
@ -135,9 +135,9 @@ function Util.round(num, idp)
|
||||
return util.signum(num) * math.floor(math.abs(num) * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
function Util.random(max, min)
|
||||
function Util.randomFloat(max, min)
|
||||
min = min or 0
|
||||
return math.random(0, max-min) + min
|
||||
return (max-min) * math.random() + min
|
||||
end
|
||||
|
||||
--[[ Table functions ]] --
|
||||
|
Loading…
Reference in New Issue
Block a user