summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-23 23:57:01 +0000
committersmatz <smatz@openttd.org>2009-01-23 23:57:01 +0000
commit3964b2dd8c49324a12c11ef91b0f592a01c6c0aa (patch)
treed62232e768532e7aee12114dd72600b61d986c0e /src/saveload
parent3d21639d5b733ca70e824517887c205c7a27b58d (diff)
downloadopenttd-3964b2dd8c49324a12c11ef91b0f592a01c6c0aa.tar.xz
(svn r15248) -Fix [FS#2561]: we require v->cur_speed to be zero for wagons and non-front engines
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/vehicle_sl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index b51c17655..bdebec8a0 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -274,8 +274,15 @@ void AfterLoadVehicles(bool part_of_load)
}
/* Stop non-front engines */
- FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_TRAIN && IsTrainEngine(v) && !IsFrontEngine(v)) v->vehstatus |= VS_STOPPED;
+ if (CheckSavegameVersion(112)) {
+ FOR_ALL_VEHICLES(v) {
+ if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
+ if (IsTrainEngine(v)) v->vehstatus |= VS_STOPPED;
+ /* cur_speed is now relevant for non-front parts - nonzero breaks
+ * moving-wagons-inside-depot- and autoreplace- code */
+ v->cur_speed = 0;
+ }
+ }
}
FOR_ALL_VEHICLES(v) {