17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

use random_device for local generator

This commit is contained in:
maj00r
2026-09-14 19:11:07 +02:00
parent 1c2f397fc5
commit 2945f3f9b2
4 changed files with 5 additions and 15 deletions

View File

@@ -320,9 +320,11 @@ int eu07_application::init(int Argc, char *Argv[])
return result;
}
// the run's seed, settled once and kept in Globals: the engines come out of it
if (!Global.random_seed)
Global.random_seed = clock_seed();
Global.random_seed = std::random_device{}();
Global.random_engine.seed(Global.random_seed);
Global.local_random_engine.seed(Global.random_seed);
// configure the OS console according to Globals.ShowSystemConsole.
// must run AFTER init_settings (so the ini-loaded value is honoured) and
@@ -1432,7 +1434,6 @@ int eu07_application::init_data()
int eu07_application::init_modes()
{
Global.local_random_engine.seed(clock_seed());
if ((!Global.network_servers.empty() || Global.network_client) && Global.SceneryFile.empty())
{