[15.25]math.random non deterministic
Posted: Fri Jun 30, 2017 10:19 am
Luas math.random seems to be non deterministic depending on how you call it inside your scripts:
/test_random1 desyncs every time, whereas test_random2 never desyncs
Related mod bug report + commit that solved it: https://github.com/Choumiko/FARL/issues/85
Mod to reproduce the desync attached
Code: Select all
local math = math
local random = math.random
local random1 = function()
game.print(random())
end
local random2 = function()
game.print(math.random())
end
commands.add_command("test_random1", "", random1)
commands.add_command("test_random2", "", random2)
Related mod bug report + commit that solved it: https://github.com/Choumiko/FARL/issues/85
Mod to reproduce the desync attached