diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 1f58b1f87e..006a37700f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -752,6 +752,12 @@ int main(int argc, const char* argv[]) { std::string error_string; + // Headless never loads a config file, so without this every setting not named below keeps the + // zero-initialized value instead of its real default, and headless runs games differently from + // every other build (bFastMemory and bFuncReplacements are both "true" defaults that came out + // false that way). Apply the defaults first, then force the values the tests want. + g_Config.RestoreDefaults(RestoreSettingsBits::SETTINGS, false); + // Force known values for deterministic test execution. This happens before // ApplyToConfig() below, so a matching command line flag can still override any of it - // ApplyToConfig() always has the final say on the settings in g_Config.