diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 860e8bac42..eb7025cee6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#25286] Footpath area dragging tool. - Feature: [#25379] Add an option to the command line screenshot function to draw debug segment heights. +- Improved: [#25297] Paths on the ground in SV4/SC4 no longer block supports of the paths above. - Improved: [#25349] ‘Recent Messages’ window can now be fully themed. - Change: [#25089] Peep actions and animations that cause them to stop moving no longer trigger when they are on a level crossing. - Change: [#25337] Placing track designs with scenery that is obstructed no longer disables all of the scenery. diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1576d53d05..e3aad3ce36 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -74,6 +74,7 @@ #include "../world/tile_element/EntranceElement.h" #include "../world/tile_element/LargeSceneryElement.h" #include "../world/tile_element/PathElement.h" +#include "../world/tile_element/Slope.h" #include "../world/tile_element/SmallSceneryElement.h" #include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TileElement.h" @@ -1630,6 +1631,7 @@ namespace OpenRCT2::RCT1 SetTileElements(gameState, std::move(tileElements)); FixEntrancePositions(gameState); + FixSupportsOnGroundPath(gameState); } size_t ImportTileElement(TileElement* dst, const RCT12TileElement* src) @@ -2549,6 +2551,39 @@ namespace OpenRCT2::RCT1 } } + void FixSupportsOnGroundPath(GameState_t& gameState) + { + TileElementIterator it; + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) + { + if (it.element->GetType() != TileElementType::Path) + continue; + + auto* pathElement = it.element->AsPath(); + if (pathElement->IsSloped()) + continue; + + if (pathElement->IsQueue()) + continue; + + auto* surface = MapGetSurfaceElementAt(TileCoordsXY(it.x, it.y)); + if (surface == nullptr) + continue; + + if (surface->GetSlope() != kTileSlopeFlat) + continue; + + if (surface->GetBaseZ() != pathElement->GetBaseZ()) + continue; + + // RCT1 would always draw supports around a path if it was flat on the ground. + // In RCT2, this depends on the support type of the path, even though that isn’t even visible in this case. + // As such, always import footpath that is on the ground with box supports. + pathElement->SetRailingsEntryIndex(RCT1_PATH_SUPPORT_TYPE_TRUSS); + } + } + RCT12::EntryList* GetEntryList(ObjectType objectType) { switch (objectType)