1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Part of #20070: missing sloped footpath in scenarios

Scenarios amended:
- Alton Towers
- Rollercoaster Heaven
This commit is contained in:
Brendan Heinonen
2024-11-04 17:46:52 -05:00
committed by Tulio Leao
parent 5da7d0e4db
commit 7d958e63df
5 changed files with 103 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
{
"scenario_name": "Rollercoaster Heaven",
"sha256": "0b8cc952c399e1515546a4ababe5ba2f7aace83915a7e51c56ee901568c9ef56",
"elements_to_delete": [
{
"element_index": 0,
"coordinates": [
[ 23, 79 ], [ 24, 79 ]
]
},
{
"element_index": 1,
"coordinates": [
[ 87, 13 ]
]
}
],
"paths": [
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct2.footpath_surface.crazy_paving",
"coordinates": [ [ 24, 79, 14 ], [ 87, 13, 18 ] ]
},
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct2.footpath_surface.crazy_paving",
"coordinates": [ [ 23, 79, 12 ] ],
"slope_direction": 2
}
]
}

View File

@@ -13,6 +13,12 @@
"railings": "rct2.footpath_railings.wood",
"surface": "rct1.footpath_surface.crazy_paving",
"coordinates": [ [ 83, 81, 22 ] ]
},
{
"railings": "rct2.footpath_railings.wood",
"surface": "rct1.footpath_surface.crazy_paving",
"coordinates": [ [ 85, 77, 22 ] ],
"slope_direction": 2
}
]
}

View File

@@ -0,0 +1,31 @@
{
"scenario_name": "Rollercoaster Heaven (.sea)",
"sha256": "eabcb3d924e8e3438bfd90f6758a723c89df4136a817533d34985598d58ba38f",
"elements_to_delete": [
{
"element_index": 0,
"coordinates": [
[ 23, 79 ], [ 24, 79 ]
]
},
{
"element_index": 1,
"coordinates": [
[ 87, 13 ]
]
}
],
"paths": [
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct2.footpath_surface.crazy_paving",
"coordinates": [ [ 24, 79, 14 ], [ 87, 13, 18 ] ]
},
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct2.footpath_surface.crazy_paving",
"coordinates": [ [ 23, 79, 12 ] ],
"slope_direction": 2
}
]
}

View File

@@ -51,6 +51,8 @@
'33bac63d13aa7513ac8536d865cbc6fa4a2189c79e3943869e6380072e71bce7'],
'Rock n Roll Revival': ['d48bbfe',
'd48bbfe4833347dfbf5befe63eb3795df3bce36cdc9152048ee7851e36d45ad9'],
'Rollercoaster Heaven': ['0b8cc95',
'0b8cc952c399e1515546a4ababe5ba2f7aace83915a7e51c56ee901568c9ef56'],
'Schneider Shores': ['e57112f',
'e57112f58a7710d3e80242e867fb65d720e0cd3b67bebfd6b7df8b404fc7ea2b'],
'Sherwood Forest': ['825134a',
@@ -207,6 +209,8 @@
'b43b07e47f2e6cb762a86760ac0242595617aa59bfd9811cec7e2dcc121ae367'],
'Rock n Roll Revival': ['f71c978',
'f71c9788ab40ac591d5c96397fad8b12d9d3ac7830eac53f6ee5dc024c8c2bcf'],
'Rollercoaster Heaven': ['eabcb3d',
'eabcb3d924e8e3438bfd90f6758a723c89df4136a817533d34985598d58ba38f'],
'Schneider Shores': ['0d53bdc',
'0d53bdc076d75d86b31b6b3e6948e3d45671cf5aeff6b2b3c07a7618923223f5'],
'Sherwood Forest': ['a04b536',
@@ -220,4 +224,4 @@
'Six Flags over Texas': ['6226822',
'62268223a1539c92b7494973263457c9e9bf386c1e68eef21d377854f0ac0e38'],
'Wacky Waikiki': ['72cf3d2',
'72cf3d220740fd64f7681d3533320598cf6d3b71dff484bc43045e8d9d7a1a4b'],
'72cf3d220740fd64f7681d3533320598cf6d3b71dff484bc43045e8d9d7a1a4b'],

View File

@@ -79,6 +79,7 @@ static const std::string _operationKey = "operation";
static const std::string _pathsKey = "paths";
static const std::string _railingsKey = "railings";
static const std::string _surfaceKey = "surface";
static const std::string _directionKey = "slope_direction";
static u8string ToOwnershipJsonKey(int ownershipType)
{
@@ -161,6 +162,29 @@ static std::vector<TTileCoords> getCoordinates(const json_t& parameters)
return parsedCoordinates;
}
static Direction GetDirection(const json_t& parameters)
{
if (!parameters.contains(_directionKey))
{
return INVALID_DIRECTION;
}
else if (!parameters[_directionKey].is_number())
{
OpenRCT2::Guard::Assert(0, "Fix direction must be a number");
return INVALID_DIRECTION;
}
Direction direction = OpenRCT2::Json::GetNumber<Direction>(parameters[_directionKey]);
if (direction > 3)
{
OpenRCT2::Guard::Assert(0, "Direction must be between 0 and 3");
return INVALID_DIRECTION;
}
return direction;
}
static void ApplyLandOwnershipFixes(const json_t& landOwnershipFixes, int ownershipType)
{
auto ownershipTypeKey = ToOwnershipJsonKey(ownershipType);
@@ -604,6 +628,7 @@ static void ApplyPathFixes(const json_t& scenarioPatch)
}
auto coordinates = getCoordinates<TileCoordsXYZ>(pathFix);
Direction direction = GetDirection(pathFix);
for (auto coordinate : coordinates)
{
@@ -612,6 +637,11 @@ static void ApplyPathFixes(const json_t& scenarioPatch)
pathElement->SetSurfaceEntryIndex(surfaceObjIndex);
pathElement->SetRailingsEntryIndex(railingsObjIndex);
if (direction != INVALID_DIRECTION)
{
pathElement->SetSloped(true);
pathElement->SetSlopeDirection(direction);
}
FootpathQueueChainReset();
FootpathConnectEdges(