From ad2b1959c8a8a57b312ec9789d9ab989de1b504e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 5 Aug 2023 17:54:44 +0300 Subject: [PATCH] Return PathElement instead of TileElement on MapGetFootpathElement --- src/openrct2/world/Footpath.cpp | 4 ++-- src/openrct2/world/Footpath.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 07d625172c..c5f8eb7bd2 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -119,7 +119,7 @@ static bool entrance_has_direction(const EntranceElement& entranceElement, int32 return entranceElement.GetDirections() & (1 << (direction & 3)); } -TileElement* MapGetFootpathElement(const CoordsXYZ& coords) +PathElement* MapGetFootpathElement(const CoordsXYZ& coords) { TileElement* tileElement = MapGetFirstElementAt(coords); do @@ -127,7 +127,7 @@ TileElement* MapGetFootpathElement(const CoordsXYZ& coords) if (tileElement == nullptr) break; if (tileElement->GetType() == TileElementType::Path && tileElement->GetBaseZ() == coords.z) - return tileElement; + return tileElement->AsPath(); } while (!(tileElement++)->IsLastForTile()); return nullptr; diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 03d935d364..4d03a29a5a 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -17,6 +17,7 @@ class FootpathObject; class FootpathSurfaceObject; class FootpathRailingsObject; +struct PathElement; enum { @@ -184,7 +185,7 @@ extern const std::array DirectionOffsets; extern const std::array BinUseOffsets; extern const std::array BenchUseOffsets; -TileElement* MapGetFootpathElement(const CoordsXYZ& coords); +PathElement* MapGetFootpathElement(const CoordsXYZ& coords); void FootpathInterruptPeeps(const CoordsXYZ& footpathPos); money64 FootpathProvisionalSet( ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope,