# HG changeset patch # User frosch # Date 2011-04-15 19:03:55 # Node ID 1c1132cf940b5813f44c3f7d07e2d530ec760152 # Parent 9b13072e96ff44c89f1847292984d9c97591ddaf (svn r22324) -Fix: Vehicles skipped orders when inserting automatic orders failed. diff --git a/src/vehicle.cpp b/src/vehicle.cpp --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1919,6 +1919,13 @@ void Vehicle::HandleLoading(bool mode) this->LeaveStation(); + /* Only advance to next order if we just loaded at the current one */ + const Order *order = this->GetOrder(this->cur_auto_order_index); + if (order == NULL || + (!order->IsType(OT_AUTOMATIC) && !order->IsType(OT_GOTO_STATION)) || + order->GetDestination() != this->last_station_visited) { + return; + } break; }