From 7a2a312e62d9d2d276717bebc3d73c7ed81c18be Mon Sep 17 00:00:00 2001 From: Samu Date: Mon, 8 Apr 2019 04:10:25 +0100 Subject: [PATCH] Fix: AI/GS settings with the flag SCRIPTCONFIG_RANDOM could be altered after loading from a savegame. Non-Random AI/GS configured in the main menu with their settings left at their defaults, could have their SCRIPTCONFIG_RANDOM flagged settings randomized when loading from a saved game. This patch disallows SM_LOAD_GAME switch mode from randomizing them. --- src/script/script_config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/script_config.cpp b/src/script/script_config.cpp index d86191b5f7..b74b148bd4 100644 --- a/src/script/script_config.cpp +++ b/src/script/script_config.cpp @@ -33,7 +33,7 @@ void ScriptConfig::Change(std::optional name, int version, bo this->ClearConfigList(); - if (_game_mode == GM_NORMAL && this->info != nullptr) { + if (_game_mode == GM_NORMAL && _switch_mode != SM_LOAD_GAME && this->info != nullptr) { /* If we're in an existing game and the Script is changed, set all settings * for the Script that have the random flag to a random value. */ for (const auto &item : *this->info->GetConfigList()) {