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.
This commit is contained in:
seanmajorpayne 2021-10-08 07:13:04 +09:00 committed by GitHub
parent fd18ac7f85
commit 25419bb4e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -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.

View file

@ -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(