openttd.c
changeset 2617 03120a0b1e39
parent 2572 18e7b1e388d9
child 2620 3693073fef99
--- a/openttd.c	Mon Nov 07 17:31:21 2005 +0000
+++ b/openttd.c	Mon Nov 07 23:20:47 2005 +0000
@@ -1300,6 +1300,23 @@
 		}
 	}
 
+	/* In version 16.1 of the savegame, trains became aware of station lengths
+		need to initialized to the invalid state
+		players needs to set renew_keep_length too */
+	if (version < 0x1001) {
+		Vehicle *v;
+		FOR_ALL_PLAYERS(p) {
+			p->renew_keep_length = false;
+		}
+
+		FOR_ALL_VEHICLES(v) {
+			if (v->type == VEH_Train) {
+				v->u.rail.shortest_platform[0] = 255;
+				v->u.rail.shortest_platform[1] = 0;
+			}
+		}
+	}
+
 	FOR_ALL_PLAYERS(p) {
 		p->avail_railtypes = GetPlayerRailtypes(p->index);
 	}