# HG changeset patch # User rubidium # Date 1188139124 0 # Node ID cd87a7db15bf028ea0b3f0363e1b09b187906f28 # Parent 1daa825ba893c5e2fd13c14c635a2f380ea45dfc (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. diff -r 1daa825ba893 -r cd87a7db15bf src/openttd.cpp --- a/src/openttd.cpp Sun Aug 26 13:55:36 2007 +0000 +++ b/src/openttd.cpp Sun Aug 26 14:38:44 2007 +0000 @@ -2103,6 +2103,18 @@ 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::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)) {