summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-07-30 18:55:52 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-07-30 18:55:52 +0000
commit456627e01c4c4ba13aaecc6e194a8628bbd26a85 (patch)
tree1aebe9af6d0e4fac7d4a258e41e6b06ca767e08a
parent3351214e22d6437a36e45f6a7111729849a35e22 (diff)
downloadopenttd-456627e01c4c4ba13aaecc6e194a8628bbd26a85.tar.xz
(svn r25636) -Fix: invalidate last_loading_station when stopping in depot
-rw-r--r--src/vehicle.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 0ed769b76..de3e1c02c 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1439,6 +1439,10 @@ void VehicleEnterDepot(Vehicle *v)
if (t.GetDepotActionType() & ODATFB_HALT) {
/* Vehicles are always stopped on entering depots. Do not restart this one. */
_vehicles_to_autoreplace[v] = false;
+ /* Invalidate last_loading_station. As the link from the station
+ * before the stop to the station after the stop can't be predicted
+ * we shouldn't construct it when the vehicle visits the next stop. */
+ v->last_loading_station = INVALID_STATION;
if (v->owner == _local_company) {
SetDParam(0, v->index);
AddVehicleAdviceNewsItem(STR_NEWS_TRAIN_IS_WAITING + v->type, v->index);