From 44c442f8322864b549ae694939794c14657b44fa Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:50:04 +0200 Subject: [PATCH] Fix #21870: Demolishing flat ride in pause mode allows copies --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 20523aa931..ae36f0740f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -9,6 +9,7 @@ - Change: [#21855] Cheats menu dropdown no longer requires dragging. - Fix: [#866] Boat Hire boats get stuck entering track. - Fix: [#10701] No reason specified when placing door over unsuitable track. +- Fix: [#18723, #21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies. - Fix: [#19559] Custom rides with long descriptions extend into lower widgets. - Fix: [#21696] Fullscreen window option not correctly applied on macOS. - Fix: [#21787] Map generator heightmap should respect increased height limits. diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 7c1a5bd134..01909761aa 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2357,14 +2357,6 @@ static Widget _rideConstructionWidgets[] = { const PreviewTrack* trackBlock = ted.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; _gotoStartPlacementMode = true; - - // When flat rides are deleted, the window should be reset so the currentRide can be placed again. - auto currentRide = GetRide(_currentRideIndex); - const auto& rtd = currentRide->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) - { - RideInitialiseConstructionWindow(*currentRide); - } } auto trackRemoveAction = TrackRemoveAction( @@ -2381,6 +2373,13 @@ static Widget _rideConstructionWidgets[] = { auto currentRide = GetRide(_currentRideIndex); if (currentRide != nullptr) { + // When flat rides are deleted, the window should be reset so the currentRide can be placed again. + const auto& rtd = currentRide->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) + { + RideInitialiseConstructionWindow(*currentRide); + } + WindowRideConstructionMouseUpDemolishNextPiece({ *newCoords, static_cast(direction) }, type); } }