diff --git a/data/scenario_patches/0b8cc95.parkpatch b/data/scenario_patches/0b8cc95.parkpatch new file mode 100644 index 0000000000..bfbf52c33e --- /dev/null +++ b/data/scenario_patches/0b8cc95.parkpatch @@ -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 + } + ] +} diff --git a/data/scenario_patches/5c95a4e.parkpatch b/data/scenario_patches/5c95a4e.parkpatch index 0f7e0a0e03..67b6961874 100644 --- a/data/scenario_patches/5c95a4e.parkpatch +++ b/data/scenario_patches/5c95a4e.parkpatch @@ -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 } ] } diff --git a/data/scenario_patches/eabcb3d.parkpatch b/data/scenario_patches/eabcb3d.parkpatch new file mode 100644 index 0000000000..e266f8fc1b --- /dev/null +++ b/data/scenario_patches/eabcb3d.parkpatch @@ -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 + } + ] +} diff --git a/data/scenario_patches/scenario_to_hash b/data/scenario_patches/scenario_to_hash index 6d352dc211..7d2b9985fb 100644 --- a/data/scenario_patches/scenario_to_hash +++ b/data/scenario_patches/scenario_to_hash @@ -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'], \ No newline at end of file + '72cf3d220740fd64f7681d3533320598cf6d3b71dff484bc43045e8d9d7a1a4b'], diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index 16dfb057d1..11e23c0ff6 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -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 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(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(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(