summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-24 00:42:09 +0000
committersmatz <smatz@openttd.org>2009-01-24 00:42:09 +0000
commit8278fc2149ac1aaa9cc4fa4a1aeaf97d0914a8c9 (patch)
tree76dc04f052853dccdf71ec47cb586ea8243c1409 /src
parent3964b2dd8c49324a12c11ef91b0f592a01c6c0aa (diff)
downloadopenttd-8278fc2149ac1aaa9cc4fa4a1aeaf97d0914a8c9.tar.xz
(svn r15249) -Fix [FS#2576]: force trains from old (and other vehicles from 'recent') savegames to have zero cur_speed while stopped (cooperation with frosch123)
Diffstat (limited to 'src')
-rw-r--r--src/saveload/vehicle_sl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index bdebec8a0..142501f54 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -282,6 +282,11 @@ void AfterLoadVehicles(bool part_of_load)
* moving-wagons-inside-depot- and autoreplace- code */
v->cur_speed = 0;
}
+ /* trains weren't stopping gradually in old OTTD versions (and TTO/TTD)
+ * other vehicle types didn't have zero speed while stopped (even in 'recent' OTTD versions) */
+ if ((v->vehstatus & VS_STOPPED) && (v->type != VEH_TRAIN || CheckSavegameVersion(1))) {
+ v->cur_speed = 0;
+ }
}
}