Fix #9720: Delay start of GS/AI to after loading of savegame (#9745)

This commit is contained in:
Loïc Guilloux
2022-12-28 05:02:26 +01:00
committed by GitHub
parent f7e2b6ef12
commit fe30f66570
11 changed files with 166 additions and 100 deletions

View File

@@ -88,6 +88,8 @@
Game::info = info;
Game::instance = new GameInstance();
Game::instance->Initialize(info);
Game::instance->LoadOnStack(config->GetToLoadData());
config->SetToLoadData(nullptr);
cur_company.Restore();
@@ -214,18 +216,6 @@
}
}
/* static */ void Game::Load(int version)
{
if (Game::instance != nullptr && (!_networking || _network_server)) {
Backup<CompanyID> cur_company(_current_company, OWNER_DEITY, FILE_LINE);
Game::instance->Load(version);
cur_company.Restore();
} else {
/* Read, but ignore, the load data */
GameInstance::LoadEmpty();
}
}
/* static */ std::string Game::GetConsoleList(bool newest_only)
{
return Game::scanner_info->GetConsoleList(newest_only);