summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-04-15 19:03:55 +0000
committerfrosch <frosch@openttd.org>2011-04-15 19:03:55 +0000
commit5eafcd8de69bad1d80609e84828c3de2bce38d24 (patch)
treea9c21818ee2352000d2b89d04c578effde90503d /src
parent2cbffe0423fd4348939a81e9892d626e9444c0a9 (diff)
downloadopenttd-5eafcd8de69bad1d80609e84828c3de2bce38d24.tar.xz
(svn r22324) -Fix: Vehicles skipped orders when inserting automatic orders failed.
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index e3ffbbc91..f4f38bd9c 100644
--- 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;
}