mirror of https://github.com/OpenTTD/OpenTTD
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
parent
90084dc74d
commit
7a2a312e62
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in New Issue