1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-31 02:35:46 +01:00

Fix #23814: Scenarios not indexed on first start

This commit is contained in:
Michael Steenbeek
2025-02-20 17:30:23 +01:00
committed by GitHub
parent 7de61c791d
commit c7c13ec8d9
2 changed files with 8 additions and 4 deletions

View File

@@ -174,10 +174,6 @@ namespace OpenRCT2
, _audioContext(audioContext)
, _uiContext(uiContext)
, _localisationService(std::make_unique<LocalisationService>(env))
, _objectRepository(CreateObjectRepository(_env))
, _objectManager(CreateObjectManager(*_objectRepository))
, _trackDesignRepository(CreateTrackDesignRepository(_env))
, _scenarioRepository(CreateScenarioRepository(_env))
, _replayManager(CreateReplayManager())
, _gameStateSnapshots(CreateGameStateSnapshots())
#ifdef ENABLE_SCRIPTING
@@ -466,6 +462,13 @@ namespace OpenRCT2
_env->SetBasePath(DIRBASE::RCT2, rct2InstallPath);
}
// The repositories are all dependent on the RCT2 path being set,
// so they cannot be set in the constructor.
_objectRepository = CreateObjectRepository(_env);
_objectManager = CreateObjectManager(*_objectRepository);
_trackDesignRepository = CreateTrackDesignRepository(_env);
_scenarioRepository = CreateScenarioRepository(_env);
if (!gOpenRCT2Headless)
{
_assetPackManager = std::make_unique<AssetPackManager>();