From 1bf49f95badda0bfa3468e78a988a1f87e58ac87 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 12 Jul 2022 20:09:20 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20#17444:=20=E2=80=9CManta=20Ray=E2=80=9D?= =?UTF-8?q?=20boats=20slowed=20down=20too=20much=20in=20=E2=80=9CAyers=20R?= =?UTF-8?q?ock=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distribution/changelog.txt | 1 + src/openrct2/rct2/S6Importer.cpp | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0102539d23..f379860ddd 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Feature: [#16662] Show a warning message when g2.dat is mismatched. - Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection. - Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements. +- Fix: [#17444] “Manta Ray” boats slowed down too much in “Ayers Rock” scenario (original bug). 0.4.1 (2022-07-04) ------------------------------------------------------------------------ diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index a763add24c..808d2aaec9 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -91,6 +91,7 @@ namespace RCT2 S6Data _s6{}; uint8_t _gameVersion = 0; bool _isSV7 = false; + bool _isScenario = false; OpenRCT2::BitSet _isFlatRide{}; ObjectEntryIndex _pathToSurfaceMap[16]; ObjectEntryIndex _pathToQueueSurfaceMap[16]; @@ -205,6 +206,7 @@ namespace RCT2 chunkReader.ReadChunk(&_s6.next_free_tile_element_pointer_index, 3048816); } + _isScenario = isScenario; _s6Path = path; return ParkLoadResult(GetRequiredObjects()); @@ -500,6 +502,7 @@ namespace RCT2 park.Name = GetUserString(_s6.park_name); FixLandOwnership(); + FixAyersRockScenario(); research_determine_first_of_type(); UpdateConsolidatedPatrolAreas(); @@ -571,6 +574,60 @@ namespace RCT2 } } + void FixAyersRockScenario() const + { + if (!_isScenario || !String::Equals(_s6.scenario_filename, "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 = map_get_first_element_at(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 = map_get_first_element_at(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::MaxRidesInPark; index++)