mirror of https://github.com/OpenTTD/OpenTTD
Fix 6fe445e: Removing rail station parts without ctrl pressed was also removing tracks
The behaviour of holding ctrl key is swappedpull/9967/head
parent
6893135fef
commit
374f0c7d11
|
@ -696,14 +696,16 @@ struct BuildRailToolbarWindow : Window {
|
||||||
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
||||||
/* Station */
|
/* Station */
|
||||||
if (_remove_button_clicked) {
|
if (_remove_button_clicked) {
|
||||||
Command<CMD_REMOVE_FROM_RAIL_STATION>::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed);
|
bool keep_rail = !_ctrl_pressed;
|
||||||
|
Command<CMD_REMOVE_FROM_RAIL_STATION>::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail);
|
||||||
} else {
|
} else {
|
||||||
HandleStationPlacement(start_tile, end_tile);
|
HandleStationPlacement(start_tile, end_tile);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Waypoint */
|
/* Waypoint */
|
||||||
if (_remove_button_clicked) {
|
if (_remove_button_clicked) {
|
||||||
Command<CMD_REMOVE_FROM_RAIL_WAYPOINT>::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed);
|
bool keep_rail = !_ctrl_pressed;
|
||||||
|
Command<CMD_REMOVE_FROM_RAIL_WAYPOINT>::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail);
|
||||||
} else {
|
} else {
|
||||||
TileArea ta(start_tile, end_tile);
|
TileArea ta(start_tile, end_tile);
|
||||||
Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y;
|
Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y;
|
||||||
|
|
Loading…
Reference in New Issue