diff --git a/application/application.cpp b/application/application.cpp index f3c3fe46..638eacdc 100644 --- a/application/application.cpp +++ b/application/application.cpp @@ -1200,17 +1200,6 @@ int eu07_application::init_settings(int Argc, char *Argv[]) { Global.asVersion = VERSION_INFO; - fs::path iniPath = user_config_path("eu07.ini"); - - if (!iniPath.empty() && fs::exists(iniPath)) - { - Global.LoadIniFile(iniPath.string().c_str()); - } - else - { - Global.LoadIniFile("eu07.ini"); - } - // a test run is known before the rest of the command line is read, so a command line it can't take // ends with the error code of the test, not with 0, which would pass it auto const testcommandline{simulation::parse_test_command_line(std::vector(Argv, Argv + Argc))}; @@ -1226,6 +1215,19 @@ int eu07_application::init_settings(int Argc, char *Argv[]) Global.test.timeout_from_command_line = true; } + fs::path iniPath = user_config_path("eu07.ini"); + + // a test reads the settings of the game folder only (and those given with -ini), not the player's own + // (%APPDATA%/MaSzyna, ~/.config/MaSzyna), so it runs the same for whoever runs it + if (false == Global.test.enabled && !iniPath.empty() && fs::exists(iniPath)) + { + Global.LoadIniFile(iniPath.string().c_str()); + } + else + { + Global.LoadIniFile("eu07.ini"); + } + // process command line arguments bool sceneryfromcommandline{false}; bool editwithoutscenery{false}; diff --git a/tests/scenarios/README.md b/tests/scenarios/README.md index acab07e7..ca45dc34 100644 --- a/tests/scenarios/README.md +++ b/tests/scenarios/README.md @@ -19,6 +19,9 @@ eu07 --test -s [--test-timeout ] [-seed ] [- With `--test` the simulator: - needs `-s`; `-v` is ignored and every train is driven by AI (ghostview), +- reads the settings of the game folder's `eu07.ini` and of the files given with `-ini` (in that + order), not the player's own `eu07.ini` in `%APPDATA%\MaSzyna` (`~/.config/MaSzyna` on Linux), + so a test runs the same for whoever runs it, - draws nothing: the null renderer loads the 3D models (the physics needs some of their data) but no textures, and the window stays hidden, - has no sound, no network, no python, no pause (not even one set by the scenery), and diff --git a/tests/scenarios/run.py b/tests/scenarios/run.py index 886e2e90..9cc6f84a 100644 --- a/tests/scenarios/run.py +++ b/tests/scenarios/run.py @@ -62,7 +62,8 @@ EXIT_RESULTS = { 14: "error", } -# settings layered over the user's eu07.ini for a test run; the window ones only matter +# settings layered over the game's eu07.ini for a test run (test mode doesn't read the player's own +# in %APPDATA%); the window ones only matter # with --watch, test mode keeps its window hidden and turns the sound off by itself TEST_INI = """\ fullscreen no