summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-18 08:50:17 +0000
committercelestar <celestar@openttd.org>2006-04-18 08:50:17 +0000
commite75e4e8f74614e360414c7ec43899b8c461c911f (patch)
tree30ec24c2a1d82c9e46e78489ed951320b67741d9 /openttd.c
parent62f7907d3a5210160a1a3bf134e95213382c9c90 (diff)
downloadopenttd-e75e4e8f74614e360414c7ec43899b8c461c911f.tar.xz
(svn r4466) -Fix: (FS#71) Game no longer crashes when the last vehicle serving a station has been deleted.
-Negative side effect: upon loading old games, stations whose last vehicle was a station have (temporarily) lower ratings. -Positive side effect: station.h no longer includes vehicle.h (breaks the station.h->vehicle.h->rail.h chain)
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openttd.c b/openttd.c
index 0818b03d4..e924a6ea2 100644
--- a/openttd.c
+++ b/openttd.c
@@ -1403,6 +1403,13 @@ bool AfterLoadGame(void)
}
}
+ if (CheckSavegameVersion(26)) {
+ Station *st;
+ FOR_ALL_STATIONS(st) {
+ st->last_vehicle_type = VEH_Invalid;
+ }
+ }
+
FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index);
return true;