diff options
author | smatz <smatz@openttd.org> | 2010-04-24 14:29:30 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2010-04-24 14:29:30 +0000 |
commit | 4a9ef6ce6094b95f1a688ae1563d002f9ff71e07 (patch) | |
tree | dd9ba4bfa0ca5762efc6f4ccf76d531edc1354c4 /src/depot_gui.cpp | |
parent | f56ebd81c35beb0094c487cc3dc45dc0427fae46 (diff) | |
download | openttd-4a9ef6ce6094b95f1a688ae1563d002f9ff71e07.tar.xz |
(svn r19710) -Codechange: deduplicate GUI code for starting/stopping vehicles
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index fef980725..e6d5dfc7c 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -508,18 +508,9 @@ struct DepotWindow : Window { ShowVehicleViewWindow(v); break; - case MODE_START_STOP: { // click start/stop flag - uint command; - - switch (this->type) { - case VEH_TRAIN: command = CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_TRAIN); break; - case VEH_ROAD: command = CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_ROAD_VEHICLE); break; - case VEH_SHIP: command = CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_SHIP); break; - case VEH_AIRCRAFT: command = CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_AIRCRAFT); break; - default: NOT_REACHED(); - } - DoCommandP(v->tile, v->index, 0, command); - } break; + case MODE_START_STOP: // click start/stop flag + StartStopVehicle(v); + break; default: NOT_REACHED(); } |