diff --git a/data/scenario_patches/Infernal Views.json b/data/scenario_patches/Infernal Views.json new file mode 100644 index 0000000000..185a324493 --- /dev/null +++ b/data/scenario_patches/Infernal Views.json @@ -0,0 +1,10 @@ +{ + "water": [ + { + "height": 96, + "coordinates": [ + [ 45, 62 ] + ] + } + ] +} diff --git a/data/scenario_patches/Six Flags Holland.json b/data/scenario_patches/Six Flags Holland.json index abe39dfdcd..d2ac6f1610 100644 --- a/data/scenario_patches/Six Flags Holland.json +++ b/data/scenario_patches/Six Flags Holland.json @@ -12,5 +12,13 @@ [ 46, 51 ], [ 58, 159 ], [ 71, 201 ], [ 126, 15 ], [ 190, 6 ] ] } - } + }, + "water": [ + { + "height": 96, + "coordinates": [ + [ 126, 73 ] + ] + } + ] } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index d82f0d527b..81a981c03f 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -192,7 +192,9 @@ namespace OpenRCT2::RCT1 ImportScenarioNameDetails(gameState); ImportScenarioObjective(gameState); ImportSavedView(); - FixLandOwnership(); + + // TODO: investigate why Katie's Dreamland.s4 and .sea have different patches + RCT12::FetchAndApplyScenarioPatch(_s4.ScenarioName, _isScenario); FixUrbanPark(); FixNextGuestNumber(gameState); CountBlockSections(); @@ -2514,13 +2516,6 @@ namespace OpenRCT2::RCT1 return justText.data(); } - void FixLandOwnership() - { - // TODO: Land ownership is applied even when loading saved scenario. Should it? - RCT12::FetchAndApplyScenarioPatch(_s4.ScenarioName); - // TODO: investigate why Katie's Dreamland.s4 and .sea have different patches - } - /** * In Urban Park, the entrance and exit of the merry-go-round are the wrong way round. This code fixes that. * To avoid messing up saves (in which this problem is most likely solved by the user), only carry out this diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index fd6ab19992..71871ad34d 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -506,8 +506,11 @@ namespace OpenRCT2::RCT2 gameState.Park.Name = GetUserString(_s6.ParkName); - FixLandOwnership(); - FixWater(); + // Checking _s6.ScenarioFilename is generally more reliable as it survives renaming. + // However, some WW/TT scenarios have this incorrectly set to "Six Flags Magic Mountain.SC6", + // 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(); @@ -534,40 +537,6 @@ namespace OpenRCT2::RCT2 gameState.ScenarioDetails = RCT2StringToUTF8(gameState.ScenarioDetails, RCT2LanguageId::EnglishUK); } - void FixLandOwnership() const - { - // Checking _s6.ScenarioFilename is generally more reliable as it survives renaming. - // However, some WW/TT scenarios have this incorrectly set to "Six Flags Magic Mountain.SC6", - // so for those cases (as well as for SFMM proper, we’ll have to check the filename. - // TODO: Land ownership is applied even when loading saved scenario. Should it? - RCT12::FetchAndApplyScenarioPatch( - _s6.ScenarioFilename != gScenarioFileName ? gScenarioFileName : _s6.ScenarioFilename); - } - - void FixWater() const - { - if (!_isScenario) - { - return; - } - if (String::IEquals(_s6.ScenarioFilename, "Infernal Views.SC6") - || String::IEquals(_s6.ScenarioFilename, "infernal views.sea")) - { - auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ 45, 62 }); - - surfaceElement->SetWaterHeight(96); - } - else if ( - String::Equals(_s6.ScenarioFilename, "Six Flags Holland.SC6", true) - || String::Equals(_s6.ScenarioFilename, "six flags holland.sea", true)) - - { - auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ 126, 73 }); - - surfaceElement->SetWaterHeight(96); - } - } - void FixAyersRockScenario() const { if (!_isScenario || !String::Equals(_s6.ScenarioFilename, "Australasia - Ayers Rock.SC6"))