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
commitf73956888f7217de128412fc64c393fa25d4ac9e (patch)
treeb83c08e47140035266c2ff811b856d2c2d2cc116
parentb50f694a857cc27934e4247fff197f222dc8b1e7 (diff)
downloadopenttd-f73956888f7217de128412fc64c393fa25d4ac9e.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;