summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-10 20:27:28 +0000
committerrubidium <rubidium@openttd.org>2007-06-10 20:27:28 +0000
commit77b06e922fcb9d8a23e8fab3f07fc377c3c2a275 (patch)
treeb83c08e47140035266c2ff811b856d2c2d2cc116
parentd0ad020dc685299fd3efa6aadeaea009ccbaa300 (diff)
downloadopenttd-77b06e922fcb9d8a23e8fab3f07fc377c3c2a275.tar.xz
(svn r10084) -Fix [FS#855]: reversing a train when loading at a station crashed.
-rw-r--r--src/economy.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 194c535f3..9a8ff2161 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1468,6 +1468,13 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
return;
}
+ if (v->type == VEH_TRAIN && !IsTileType(v->tile, MP_STATION)) {
+ /* The train reversed in the station. Take the "easy" way
+ * out and let the train just leave as it always did. */
+ SETBIT(v->vehicle_flags, VF_LOADING_FINISHED);
+ return;
+ }
+
int unloading_time = 0;
Vehicle *u = v;
int result = 0;