From 5b21a839a9d785c2aa659ef0e2d28a398396db85 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 18 Nov 2007 08:03:48 +0000 Subject: (svn r11455) -Codechange: make autoroad, 'normal' road building and 'normal' rail building all react the same on CTRL as autorail. --- src/rail_gui.cpp | 10 ++++++---- src/road_gui.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 1b107bb3b..3e90151cf 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -516,8 +516,7 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e) if (_ctrl_pressed) _remove_button_clicked = true; HandleAutodirPlacement(); _remove_button_clicked = old; - break; - } + } break; case DDSP_BUILD_SIGNALS: HandleAutoSignalPlacement(); @@ -540,9 +539,12 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e) break; case DDSP_PLACE_RAIL_NE: - case DDSP_PLACE_RAIL_NW: + case DDSP_PLACE_RAIL_NW: { + bool old = _remove_button_clicked; + if (_ctrl_pressed) _remove_button_clicked = true; DoRailroadTrack(e->we.place.select_proc == DDSP_PLACE_RAIL_NE ? TRACK_X : TRACK_Y); - break; + _remove_button_clicked = old; + } break; } } break; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 0be5a0355..e66e083c0 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -504,7 +504,7 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); DoCommandP(end_tile, start_tile, _place_road_flag | (_cur_roadtype << 3) | _ctrl_pressed << 5, CcPlaySound1D, - _remove_button_clicked ? + (_ctrl_pressed || _remove_button_clicked) ? CMD_REMOVE_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) : CMD_BUILD_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road)); break; -- cgit v1.2.3-70-g09d2