1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Fix #17605. Prevent crash when parks include missing objects (#17606)

* Fix #17605. Prevent crash when parks include missing objects

Specifically the park needs to have had removed an object that is referenced within a scenery group object.
This commit is contained in:
Duncan
2022-07-26 15:33:30 +01:00
committed by GitHub
parent 628da77c0e
commit 68ded02b14
2 changed files with 7 additions and 1 deletions

View File

@@ -113,7 +113,12 @@ void SceneryGroupObject::UpdateEntryIndexes()
continue;
auto entryIndex = objectManager.GetLoadedObjectEntryIndex(ori->LoadedObject.get());
Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE);
if (entryIndex == OBJECT_ENTRY_INDEX_NULL)
{
// Some parks have manually deleted objects from the save so they might not be loaded
// silently remove the object from the SceneryGroupObject
continue;
}
auto sceneryType = GetSceneryType(ori->Type);
if (sceneryType.has_value())