From e216c942566c8bc2ea0fd87ffb9c5dca884bdd95 Mon Sep 17 00:00:00 2001 From: mix <167040362+mixiate@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:46:29 +0000 Subject: [PATCH] Fix #14365: Previews broken for track designs with scenery below track --- distribution/changelog.txt | 1 + src/openrct2/ride/TrackDesign.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d067a144f8..62138fb6bb 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.29 (in development) ------------------------------------------------------------------------ +- Fix: [#14365] Track designs with scenery below the lowest track piece do not preview correctly. - Fix: [#25451] Dropdown item tooltips stay open if the mouse is moved over an empty space. 0.4.28 (2025-11-01) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 307f45478c..bb07e65998 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1942,16 +1942,14 @@ static bool TrackDesignPlacePreview( auto mapSize = TileCoordsXY{ gameState.mapSize.x * 16, gameState.mapSize.y * 16 }; _currentTrackPieceDirection = 0; - int32_t z = TrackDesignGetZPlacement( - tds, td, RideGetTemporaryForPreview(), { mapSize.x, mapSize.y, 16, _currentTrackPieceDirection }); + const CoordsXYZD coords = { mapSize.x, mapSize.y, kMinimumLandZ, _currentTrackPieceDirection }; + const int32_t z = kMinimumLandZ + TrackDesignGetZPlacement(tds, td, RideGetTemporaryForPreview(), coords); if (tds.hasScenery) { gameStateData.setFlag(TrackDesignGameStateFlag::HasScenery, true); } - z += 16 - tds.placeSceneryZ; - if (_trackDesignPlaceStateSceneryUnavailable) { placeScenery = false;