Fix: [Script] Apply random deviation only at script start (#11944)

This commit is contained in:
Loïc Guilloux
2024-02-01 10:48:40 +01:00
committed by GitHub
parent e28edf6945
commit ab1407fc43
6 changed files with 8 additions and 11 deletions

View File

@@ -31,8 +31,9 @@ public:
/**
* Start up a new GameScript.
* @param randomise Whether to randomise the configured GameScript.
*/
static void StartNew();
static void StartNew(bool randomise = true);
/**
* Uninitialize the Game system.

View File

@@ -69,7 +69,7 @@
}
}
/* static */ void Game::StartNew()
/* static */ void Game::StartNew(bool randomise)
{
if (Game::instance != nullptr) return;
@@ -83,6 +83,7 @@
GameInfo *info = config->GetInfo();
if (info == nullptr) return;
if (randomise) config->AddRandomDeviation();
config->AnchorUnchangeableSettings();
Backup<CompanyID> cur_company(_current_company, FILE_LINE);