changeset 6844:70d60b0104c1 draft

(svn r10084) -Fix [FS#855]: reversing a train when loading at a station crashed.
author rubidium <rubidium@openttd.org>
date Sun, 10 Jun 2007 20:27:28 +0000
parents 985ee48901eb
children 29cfcc6c2198
files src/economy.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1468,6 +1468,13 @@
 		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;