summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-11 13:38:34 +0000
committerrubidium <rubidium@openttd.org>2011-02-11 13:38:34 +0000
commitb1873526635efa1b6fb2e2ba636f0d3368a9389e (patch)
tree7ee2c283fcc6b03ca1d48e1d2a40148c251e076b /src/saveload
parent13fd2cd335f1162758348ae3e2e9c2a1a4cc5602 (diff)
downloadopenttd-b1873526635efa1b6fb2e2ba636f0d3368a9389e.tar.xz
(svn r22058) -Fix (r22050): removing broken orders happened before the "front engine" conversion was done for road vehicles, so road vehicles didn't have orders anymore
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/vehicle_sl.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 6b677fcf0..4529dc50a 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -289,12 +289,6 @@ 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;
- }
}
}
@@ -336,6 +330,16 @@ void AfterLoadVehicles(bool part_of_load)
}
}
}
+
+ if (IsSavegameVersionBefore(160)) {
+ /* In some old savegames there might be some "crap" stored. */
+ FOR_ALL_VEHICLES(v) {
+ if (!v->IsPrimaryVehicle()) {
+ v->current_order.Free();
+ v->unitnumber = 0;
+ }
+ }
+ }
}
CheckValidVehicles();