From c98441d1aa3abcf1d83a166671d56efa901b8c06 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Thu, 2 Jul 2026 03:06:28 +0200 Subject: [PATCH] Initialize random seed early in the init sequence Network client will overwrite the seed if necessary. --- application/application.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/application.cpp b/application/application.cpp index 4c718f3a..030a441b 100644 --- a/application/application.cpp +++ b/application/application.cpp @@ -320,6 +320,10 @@ int eu07_application::init(int Argc, char *Argv[]) return result; } + if (!Global.random_seed) + Global.random_seed = std::random_device{}(); + Global.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 // BEFORE the first WriteLog below (so colored \033[...] sequences emitted @@ -1456,10 +1460,6 @@ bool eu07_application::init_network() else { // we're simulation master - if (!Global.random_seed) - Global.random_seed = std::random_device{}(); - Global.random_engine.seed(Global.random_seed); - // TODO: sort out this timezone mess std::time_t utc_now = std::time(nullptr);