Mercurial > hg > openttd
changeset 7904:ed094cb05df3 draft
(svn r11455) -Codechange: make autoroad, 'normal' road building and 'normal' rail building all react the same on CTRL as autorail.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 18 Nov 2007 08:03:48 +0000 |
parents | 714b06108f0f |
children | 63c86d0b97e7 |
files | src/rail_gui.cpp src/road_gui.cpp |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -516,8 +516,7 @@ if (_ctrl_pressed) _remove_button_clicked = true; HandleAutodirPlacement(); _remove_button_clicked = old; - break; - } + } break; case DDSP_BUILD_SIGNALS: HandleAutoSignalPlacement(); @@ -540,9 +539,12 @@ 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;
--- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -504,7 +504,7 @@ _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;