From 43adebe815dc3970bfd2017a93a2133e70f3c56d Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sat, 20 Jan 2024 15:11:19 -0300 Subject: [PATCH] Move Ayers Rock patch to json --- .../Australasia - Ayers Rock.json | 23 ++++++++ src/openrct2/rct2/S6Importer.cpp | 55 ------------------- 2 files changed, 23 insertions(+), 55 deletions(-) create mode 100644 data/scenario_patches/Australasia - Ayers Rock.json diff --git a/data/scenario_patches/Australasia - Ayers Rock.json b/data/scenario_patches/Australasia - Ayers Rock.json new file mode 100644 index 0000000000..6a95c0b745 --- /dev/null +++ b/data/scenario_patches/Australasia - Ayers Rock.json @@ -0,0 +1,23 @@ +{ + "tiles": { + "type": "track", + "operations": [ + { + "from": "flat_covered", + "to": "flat", + "coordinates": [ + [ 123, 59 ], [ 123, 60 ], [ 123, 61 ], + [ 118, 69 ], [ 118, 70 ], [ 118, 71 ], [ 118, 72 ], [ 118, 73 ], + [ 112, 79 ], [ 112, 80 ], [ 112, 81 ], [ 112, 82 ] + ] + }, + { + "from": "flat", + "to": "flat_covered", + "coordinates": [ + [ 123, 83 ], [ 123, 84 ], [ 123, 85 ], [123, 86 ] + ] + } + ] + } +} diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 71871ad34d..4e8aa3af55 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -511,7 +511,6 @@ namespace OpenRCT2::RCT2 // so for those cases (as well as for SFMM proper, we’ll have to check the filename. RCT12::FetchAndApplyScenarioPatch( _s6.ScenarioFilename != gScenarioFileName ? gScenarioFileName : _s6.ScenarioFilename, _isScenario); - FixAyersRockScenario(); ResearchDetermineFirstOfType(); UpdateConsolidatedPatrolAreas(); @@ -537,60 +536,6 @@ namespace OpenRCT2::RCT2 gameState.ScenarioDetails = RCT2StringToUTF8(gameState.ScenarioDetails, RCT2LanguageId::EnglishUK); } - void FixAyersRockScenario() const - { - if (!_isScenario || !String::Equals(_s6.ScenarioFilename, "Australasia - Ayers Rock.SC6")) - return; - - TileCoordsXY tilesToUncovered[] = { - { 123, 59 }, { 123, 60 }, { 123, 61 }, { 118, 69 }, { 118, 70 }, { 118, 71 }, - { 118, 72 }, { 118, 73 }, { 112, 79 }, { 112, 80 }, { 112, 81 }, { 112, 82 }, - }; - for (const auto& tile : tilesToUncovered) - { - auto* tileElement = MapGetFirstElementAt(tile); - if (tileElement == nullptr) - continue; - - do - { - if (tileElement->GetType() != TileElementType::Track) - continue; - - auto* trackElement = tileElement->AsTrack(); - if (trackElement->GetTrackType() != TrackElemType::FlatCovered) - continue; - - trackElement->SetTrackType(TrackElemType::Flat); - } while (!(tileElement++)->IsLastForTile()); - } - - TileCoordsXY tilesToCovered[] = { - { 123, 83 }, - { 123, 84 }, - { 123, 85 }, - { 123, 86 }, - }; - for (const auto& tile : tilesToCovered) - { - auto* tileElement = MapGetFirstElementAt(tile); - if (tileElement == nullptr) - continue; - - do - { - if (tileElement->GetType() != TileElementType::Track) - continue; - - auto* trackElement = tileElement->AsTrack(); - if (trackElement->GetTrackType() != TrackElemType::Flat) - continue; - - trackElement->SetTrackType(TrackElemType::FlatCovered); - } while (!(tileElement++)->IsLastForTile()); - } - } - void ImportRides() { for (uint8_t index = 0; index < Limits::kMaxRidesInPark; index++)