summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-26 14:38:44 +0000
committerrubidium <rubidium@openttd.org>2007-08-26 14:38:44 +0000
commitcf1d74b41ed5652a07cca7bb666fcba30a2c2549 (patch)
tree35621bf6077b4df06aa370d3866427df840c5f93 /src/openttd.cpp
parenta0d37ea7b9e26c7f918883262160e76f004e7e8f (diff)
downloadopenttd-cf1d74b41ed5652a07cca7bb666fcba30a2c2549.tar.xz
(svn r10982) -Fix [FS#1162]: some old savegames could be in a state that the current game logic does not like; in the list of vehicles loading at a station when the vehicle is not actually at the station.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index ddd8ac99c..f17f459cb 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2103,6 +2103,18 @@ bool AfterLoadGame()
CLRBIT(v->vehicle_flags, VF_LOADING_FINISHED);
}
}
+ } else if (CheckSavegameVersion(59)) {
+ /* For some reason non-loading vehicles could be in the station's loading vehicle list */
+
+ Station *st;
+ FOR_ALL_STATIONS(st) {
+ std::list<Vehicle *>::iterator iter;
+ for (iter = st->loading_vehicles.begin(); iter != st->loading_vehicles.end();) {
+ Vehicle *v = *iter;
+ iter++;
+ if (v->current_order.type != OT_LOADING) st->loading_vehicles.remove(v);
+ }
+ }
}
if (CheckSavegameVersion(58)) {