diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c746e2f356..2a35f461bc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -48,6 +48,7 @@ - Fix: [#18469] Land rights window buttons incorrectly disabled and markers remain visible indefinitely. - Fix: [#18459] ‘Highlight path issues’ hides fences for paths with additions. - Fix: [#18552] Trains clipping through helixes. +- Fix: [#18576] Cannot open parks with certain types of corrupt tile elements. - Fix: [#18606] JSON objects do not take priority over the DAT files they supersede. - Fix: [#18620] [Plugin] Crash when reading widget properties from windows that have both static and tab widgets. - Fix: [#18653] Negative ratings multipliers do not appear in Vehicle tab. diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 89fe9f51f8..004526959a 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -30,7 +30,25 @@ using namespace OpenRCT2; RCT12TileElementType RCT12TileElementBase::GetType() const { - return static_cast((this->type & TILE_ELEMENT_TYPE_MASK) >> 2); + auto elem_type = static_cast((this->type & TILE_ELEMENT_TYPE_MASK) >> 2); + switch (elem_type) + { + case RCT12TileElementType::Surface: + case RCT12TileElementType::Path: + case RCT12TileElementType::Track: + case RCT12TileElementType::SmallScenery: + case RCT12TileElementType::Entrance: + case RCT12TileElementType::Wall: + case RCT12TileElementType::LargeScenery: + case RCT12TileElementType::Banner: + case RCT12TileElementType::Corrupt: + case RCT12TileElementType::EightCarsCorrupt14: + case RCT12TileElementType::EightCarsCorrupt15: + return elem_type; + default: + // Most corrupt elements were set to 0x255, but not all. Fallback to corrupt element if encountered unknown type. + return RCT12TileElementType::EightCarsCorrupt15; + } } uint8_t RCT12TileElementBase::GetDirection() const