fix math.random seed being the same on every launch

stdlib.lua runs from scripting::initialize before the main loop starts,
so time.uptime() is still 0 there and math.randomseed(time.uptime() *
1536227939) is math.randomseed(0). math.random() gave the same sequence
on every launch, and so did the random seed placeholder of the "New
World" page: every world created without typing a seed got the same
seed. Seed from time.precise_utc_time() instead.
This commit is contained in:
ostermine 2026-11-06 03:49:26 +03:00
parent 9be7cfa724
commit 4578915943

View file

@ -410,7 +410,7 @@ require("core:io_stream").wrap_bytearray = require "core:internal/stream_provide
network.__as_stream = require "core:internal/stream_providers/socket"
math.randomseed(time.uptime() * 1536227939)
math.randomseed(time.precise_utc_time())
rules = require "core:internal/rules"
time.schedules = {}