From 02ef545f1b87fe720ddeb2894e00462b4f47b732 Mon Sep 17 00:00:00 2001 From: aw20368 Date: Thu, 30 May 2019 14:51:56 -0400 Subject: [PATCH] Fix #9314: Trying to delete ride piece while paused moves the selection (#9332) Failed track removal was triggering a move to the next piece. Changed to move only upon successful removal. --- src/openrct2-ui/windows/RideConstruction.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 408d789a8c..757ab9c66f 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1932,12 +1932,15 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, _currentTrackPieceDirection }); trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { - _stationConstructed = get_ride(w->number)->num_stations != 0; - window_ride_construction_mouseup_demolish_next_piece(x, y, z, direction, type); if (result->Error != GA_ERROR::OK) { window_ride_construction_update_active_elements(); } + else + { + _stationConstructed = get_ride(w->number)->num_stations != 0; + window_ride_construction_mouseup_demolish_next_piece(x, y, z, direction, type); + } }); GameActions::Execute(&trackRemoveAction);