diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 8e3dc114c1..a126820e84 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#23797] 3D Text cut off too early on multi-line signs. - Fix: [#23809] Trains glitch on Bobsleigh Coaster small helixes. - Fix: [#23811] Land edges glitch when vehicles go through gentle to flat tunnels. +- Fix: [#23814] Scenarios not indexed on first start. - Fix: [#23818] Spinning tunnels can draw over sloped terrain in front of them. - Fix: [#23858] LSM launched lift hill has a misaligned sprite. diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index b7908acd30..57b926b786 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -174,10 +174,6 @@ namespace OpenRCT2 , _audioContext(audioContext) , _uiContext(uiContext) , _localisationService(std::make_unique(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();