mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-10 02:31:48 +00:00
[fixed] issue loading tablex without love
This commit is contained in:
parent
8d5da0a9ff
commit
c191a7b4f6
@ -73,8 +73,11 @@ function tablex.add_value(t, a)
|
||||
return false
|
||||
end
|
||||
|
||||
--helper for optionally passed random
|
||||
local _global_random = love.math.random or math.random
|
||||
--helper for optionally passed random; defaults to love.math.random if present, otherwise math.random
|
||||
local _global_random = math.random
|
||||
if love and love.math and love.math.random then
|
||||
_global_random = love.math.random
|
||||
end
|
||||
local function _random(min, max, r)
|
||||
return r and r:random(min, max)
|
||||
or _global_random(min, max)
|
||||
|
Loading…
Reference in New Issue
Block a user