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.
This commit is contained in:
aw20368 authored and Michael Steenbeek committed 2019-05-30 20:51:56 +02:00
1 parent bc14f427a5
commit 02ef545f1b
1 file changed
+5 -2
+5 -2
View File
@@ -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);