summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
committerrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
commit5051ef80c663e252ed6867b3cd0298d3b1c8717c (patch)
tree92906fbbf435190a120e62033f0d4bb413f9a35f /src/order_gui.cpp
parent007c9641a6706abc3afc84fda542b1915dc21d35 (diff)
downloadopenttd-5051ef80c663e252ed6867b3cd0298d3b1c8717c.tar.xz
(svn r19796) -Codechange: introduce and use a {DEPOT} string command
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 5030d003a..cc3f2571e 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -232,25 +232,19 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
} break;
case OT_GOTO_DEPOT:
- if (v->type == VEH_AIRCRAFT) {
- if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
- SetDParam(0, STR_ORDER_GO_TO_NEAREST_DEPOT_FORMAT);
+ if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
+ SetDParam(0, STR_ORDER_GO_TO_NEAREST_DEPOT_FORMAT);
+ if (v->type == VEH_AIRCRAFT) {
SetDParam(2, STR_ORDER_NEAREST_HANGAR);
+ SetDParam(3, STR_EMPTY);
} else {
- SetDParam(0, STR_ORDER_GO_TO_HANGAR_FORMAT);
- SetDParam(2, order->GetDestination());
- }
- SetDParam(3, STR_EMPTY);
- } else {
- if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
- SetDParam(0, STR_ORDER_GO_TO_NEAREST_DEPOT_FORMAT);
SetDParam(2, STR_ORDER_NEAREST_DEPOT);
- } else {
- SetDParam(0, STR_ORDER_GO_TO_DEPOT_FORMAT);
- SetDParam(2, Depot::Get(order->GetDestination())->town_index);
+ SetDParam(3, STR_ORDER_TRAIN_DEPOT + v->type);
}
-
- SetDParam(3, STR_ORDER_TRAIN_DEPOT + v->type);
+ } else {
+ SetDParam(0, STR_ORDER_GO_TO_DEPOT_FORMAT);
+ SetDParam(2, v->type);
+ SetDParam(3, order->GetDestination());
}
if (order->GetDepotOrderType() & ODTFB_SERVICE) {