summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-18 08:03:48 +0000
committerrubidium <rubidium@openttd.org>2007-11-18 08:03:48 +0000
commit5b21a839a9d785c2aa659ef0e2d28a398396db85 (patch)
tree54de90ba8b5c58c873ca41af6c4fe6c2dedd1ecd
parent80a7a917308a1cd422923e953ced86d66503906f (diff)
downloadopenttd-5b21a839a9d785c2aa659ef0e2d28a398396db85.tar.xz
(svn r11455) -Codechange: make autoroad, 'normal' road building and 'normal' rail building all react the same on CTRL as autorail.
-rw-r--r--src/rail_gui.cpp10
-rw-r--r--src/road_gui.cpp2
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;