diff --git a/src/openrct2/actions/scenery/WallPlaceAction.cpp b/src/openrct2/actions/scenery/WallPlaceAction.cpp index a382232944..b115245cf3 100644 --- a/src/openrct2/actions/scenery/WallPlaceAction.cpp +++ b/src/openrct2/actions/scenery/WallPlaceAction.cpp @@ -85,11 +85,6 @@ namespace OpenRCT2::GameActions res.position.x += 16; res.position.y += 16; - if (_loc.z == 0) - { - res.position.z = TileElementHeight(res.position); - } - if (!LocationValid(_loc)) { return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); @@ -142,6 +137,7 @@ namespace OpenRCT2::GameActions edgeSlope &= ~EDGE_SLOPE_ELEVATED; } } + res.position.z = targetHeight; auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) @@ -287,11 +283,6 @@ namespace OpenRCT2::GameActions res.position.x += 16; res.position.y += 16; - if (res.position.z == 0) - { - res.position.z = TileElementHeight(res.position); - } - uint8_t edgeSlope = 0; auto targetHeight = _loc.z; if (targetHeight == 0) @@ -312,6 +303,7 @@ namespace OpenRCT2::GameActions edgeSlope &= ~EDGE_SLOPE_ELEVATED; } } + res.position.z = targetHeight; auto targetLoc = CoordsXYZ(_loc, targetHeight); auto* wallEntry = ObjectEntryManager::GetObjectEntry(_wallType);