1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Convert S6 scenarios water fixes to patches

This commit is contained in:
Tulio Leao
2024-01-20 12:25:48 -03:00
parent c43a84e255
commit 2ac35756b2
4 changed files with 27 additions and 45 deletions

View File

@@ -0,0 +1,10 @@
{
"water": [
{
"height": 96,
"coordinates": [
[ 45, 62 ]
]
}
]
}

View File

@@ -12,5 +12,13 @@
[ 46, 51 ], [ 58, 159 ], [ 71, 201 ], [ 126, 15 ], [ 190, 6 ]
]
}
}
},
"water": [
{
"height": 96,
"coordinates": [
[ 126, 73 ]
]
}
]
}

View File

@@ -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

View File

@@ -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, well 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, well 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"))