diff options
author | rubidium <rubidium@openttd.org> | 2009-05-28 21:12:54 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-28 21:12:54 +0000 |
commit | 62a2dff61e5e41805bd85dded45bf11ba91611c8 (patch) | |
tree | e9deeea5916665ca78deb1091df0fde460e151ed /src | |
parent | d7b0aa47c5dc27184cbdcfffe31963ffa26b7ac1 (diff) | |
download | openttd-62a2dff61e5e41805bd85dded45bf11ba91611c8.tar.xz |
(svn r16457) -Fix [FS#2925]: skipping a 'nearest depot order' because none could be found could cause multiple orders to get skipped
Diffstat (limited to 'src')
-rw-r--r-- | src/order_cmd.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index c367a9e87..06f7029cc 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1628,8 +1628,15 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth) } } } else { + if (conditional_depth > v->GetNumOrders()) return false; + UpdateVehicleTimetable(v, true); v->IncrementOrderIndex(); + + /* Get the current order */ + const Order *order = v->GetOrder(v->cur_order_index); + v->current_order = *order; + return UpdateOrderDest(v, order, conditional_depth + 1); } } else if (v->type != VEH_AIRCRAFT) { v->dest_tile = Depot::Get(order->GetDestination())->xy; |