From 374f0c7d117b9f99d3ed5a6607624f2b1745960c Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Sun, 31 Jul 2022 11:59:31 +0100 Subject: [PATCH] Fix 6fe445e: Removing rail station parts without ctrl pressed was also removing tracks The behaviour of holding ctrl key is swapped --- src/rail_gui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 7bde44483f..9a813407ba 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -696,14 +696,16 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed); + bool keep_rail = !_ctrl_pressed; + Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed); + bool keep_rail = !_ctrl_pressed; + Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail); } else { TileArea ta(start_tile, end_tile); Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y;