diff options
author | michi_cc <michi_cc@openttd.org> | 2011-06-02 22:41:05 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-06-02 22:41:05 +0000 |
commit | c9af6126f81cf2578c40bfef533e4d9e6f761c6d (patch) | |
tree | 7995637ddb7abdaa7aaa6bf27102a0a6517a743f | |
parent | dbc5fdeb04d1e8c8c91e994dc141ec8000898990 (diff) | |
download | openttd-c9af6126f81cf2578c40bfef533e4d9e6f761c6d.tar.xz |
(svn r22532) -Fix: Do not create an implicit order if the current order is the first order in the order list and we visit the station of the last entry of the order list.
-rw-r--r-- | src/vehicle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 0ac745b4a..aaa027aff 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1875,7 +1875,7 @@ void Vehicle::BeginLoading() in_list->GetDestination() != this->last_station_visited)) { bool suppress_implicit_orders = HasBit(this->GetGroundVehicleFlags(), GVF_SUPPRESS_IMPLICIT_ORDERS); /* Do not create consecutive duplicates of implicit orders */ - Order *prev_order = this->cur_implicit_order_index > 0 ? this->GetOrder(this->cur_implicit_order_index - 1) : NULL; + Order *prev_order = this->cur_implicit_order_index > 0 ? this->GetOrder(this->cur_implicit_order_index - 1) : (this->GetNumOrders() > 1 ? this->GetLastOrder() : NULL); if (prev_order == NULL || (!prev_order->IsType(OT_IMPLICIT) && !prev_order->IsType(OT_GOTO_STATION)) || prev_order->GetDestination() != this->last_station_visited) { |