From cebe2001ba37fc7fb246404329063d324125faa7 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 11 Apr 2008 15:58:46 +0000 Subject: (svn r12661) -Add: ability to send a vehicle (using default orders) to the nearest depot. --- src/timetable_gui.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/timetable_gui.cpp') 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; -- cgit v1.2.3-54-g00ecf