From 25419bb4e3e46f7d7db45684b821f6bdefba3cfc Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Fri, 8 Oct 2021 07:13:04 +0900 Subject: [PATCH] Fix #15197: Cannot place flat ride after removing it in construction Demolishing a flat ride (using the bulldozer icon in the construction menu) will now reopen the construction window to it's default state. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9138486a7d..432cd2d76f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15170] Plugin: incorrect label text alignment. - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. +- Fix: [#15197] Cannot place flat ride after removing it in construction window. - Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15213] Freeze when hovering over Reverse Freefall Coaster in Russian. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 15de24f541..ca9ea239bd 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1931,6 +1931,14 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) const rct_preview_track* trackBlock = ted.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; gGotoStartPlacementMode = true; + + // When flat rides are deleted, the window should be reset so the ride can be placed again. + const auto rideId = w->rideId; + auto ride = get_ride(rideId); + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + { + ride_initialise_construction_window(ride); + } } auto trackRemoveAction = TrackRemoveAction(