summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-10 18:28:25 +0000
committerrubidium <rubidium@openttd.org>2011-02-10 18:28:25 +0000
commit50996e799bc0a2abaca04eb5e4d81dc2fef4a2a7 (patch)
tree39c19a06b51933d1d9eb0f3ac9dc211a1f67bcd5 /src
parent096c2857ee5e7cc8965812fa9f060eb9bc80e604 (diff)
downloadopenttd-50996e799bc0a2abaca04eb5e4d81dc2fef4a2a7.tar.xz
(svn r22050) -Fix-ish [FS#4496]: in ancient savegames, e.g. TTO savegames, non primary vehicles (wagons and such) could have unitnumbers or even orders. However, these orders would not be updated when a station is removed. As such some savegames have wagons with current orders to invalid stations which triggers trouble in the load conversion. So, trash any orders/unitnumbers a non-primary vehicle has.
Diffstat (limited to 'src')
-rw-r--r--src/saveload/vehicle_sl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index f264c3d10..6b677fcf0 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -289,6 +289,12 @@ void AfterLoadVehicles(bool part_of_load)
}
}
}
+
+ /* In some old savegames there might be some "crap" stored. */
+ if (IsSavegameVersionBefore(160) && !v->IsPrimaryVehicle()) {
+ v->current_order.Free();
+ v->unitnumber = 0;
+ }
}
}