summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-07-27 21:46:55 +0000
committerrubidium <rubidium@openttd.org>2010-07-27 21:46:55 +0000
commit8df78e7a7b4fcc424e34e3fecbee85b72f1891d0 (patch)
tree172e7bb0df4c1593f0277d518028ee1ac7340d3f /src
parent814be3ae668b6801dfcfb32dfd8df747368dc4e8 (diff)
downloadopenttd-8df78e7a7b4fcc424e34e3fecbee85b72f1891d0.tar.xz
(svn r20229) -Fix [FS#3986]: "Service at nearest depot" behaved the same as "Go to nearest depot"
Diffstat (limited to 'src')
-rw-r--r--src/order_cmd.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 800c4aca9..0c43bdd3f 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1712,6 +1712,12 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth)
return true;
case OT_GOTO_DEPOT:
+ if ((order->GetDepotOrderType() & ODTFB_SERVICE) && !v->NeedsServicing()) {
+ UpdateVehicleTimetable(v, true);
+ v->IncrementOrderIndex();
+ break;
+ }
+
if (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
/* We need to search for the nearest depot (hangar). */
TileIndex location;
@@ -1738,9 +1744,6 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth)
UpdateVehicleTimetable(v, true);
v->IncrementOrderIndex();
- } else if ((order->GetDepotOrderType() & ODTFB_SERVICE) && !v->NeedsServicing()) {
- UpdateVehicleTimetable(v, true);
- v->IncrementOrderIndex();
} else {
if (v->type != VEH_AIRCRAFT) {
v->dest_tile = Depot::Get(order->GetDestination())->xy;