summaryrefslogtreecommitdiff
path: root/src/timetable_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-11 15:58:46 +0000
committerrubidium <rubidium@openttd.org>2008-04-11 15:58:46 +0000
commitcebe2001ba37fc7fb246404329063d324125faa7 (patch)
tree75b2ce202d816827b4568b0bd0659c211f84cd08 /src/timetable_gui.cpp
parent3919c30c2d6fbdeef2b75192b12d01c4eee4d2f9 (diff)
downloadopenttd-cebe2001ba37fc7fb246404329063d324125faa7.tar.xz
(svn r12661) -Add: ability to send a vehicle (using default orders) to the nearest depot.
Diffstat (limited to 'src/timetable_gui.cpp')
-rw-r--r--src/timetable_gui.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 78de82f6d..372897841 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -135,11 +135,22 @@ static void DrawTimetableWindow(Window *w)
case OT_GOTO_DEPOT:
if (v->type == VEH_AIRCRAFT) {
- SetDParam(0, STR_GO_TO_HANGAR);
- SetDParam(2, order->GetDestination());
+ if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
+ SetDParam(1, STR_GO_TO_NEAREST_DEPOT);
+ SetDParam(3, STR_ORDER_NEAREST_HANGAR);
+ } else {
+ SetDParam(1, STR_GO_TO_HANGAR);
+ SetDParam(3, order->GetDestination());
+ }
+ SetDParam(4, STR_EMPTY);
} else {
- SetDParam(0, STR_GO_TO_DEPOT);
- SetDParam(2, GetDepot(order->GetDestination())->town_index);
+ if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
+ SetDParam(1, STR_GO_TO_NEAREST_DEPOT);
+ SetDParam(3, STR_ORDER_NEAREST_DEPOT);
+ } else {
+ SetDParam(1, STR_GO_TO_DEPOT);
+ SetDParam(3, GetDepot(order->GetDestination())->town_index);
+ }
switch (v->type) {
case VEH_TRAIN: SetDParam(3, STR_ORDER_TRAIN_DEPOT); break;