(svn r10084) -Fix [FS#855]: reversing a train when loading at a station crashed.
authorrubidium
Sun, 10 Jun 2007 20:27:28 +0000
changeset 7340 0ac181725a79
parent 7339 661958642f62
child 7341 1da2f9a6bd65
(svn r10084) -Fix [FS#855]: reversing a train when loading at a station crashed.
src/economy.cpp
--- a/src/economy.cpp	Sun Jun 10 19:59:08 2007 +0000
+++ b/src/economy.cpp	Sun Jun 10 20:27:28 2007 +0000
@@ -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;