1
0
Fork 0

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.
pull/11914/head
Samu 2019-04-08 04:10:25 +01:00 committed by SamuXarick
parent 90084dc74d
commit 7a2a312e62
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ void ScriptConfig::Change(std::optional<const std::string> name, int version, bo
this->ClearConfigList(); 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 /* 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 the Script that have the random flag to a random value. */
for (const auto &item : *this->info->GetConfigList()) { for (const auto &item : *this->info->GetConfigList()) {