mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
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:
parent
9be7cfa724
commit
4578915943
1 changed files with 1 additions and 1 deletions
|
|
@ -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 = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue