diff options
author | smatz <smatz@openttd.org> | 2009-01-23 23:57:01 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-01-23 23:57:01 +0000 |
commit | 59be733b1b3ae8f67c2279ab1ffb1a4fa452d66c (patch) | |
tree | d62232e768532e7aee12114dd72600b61d986c0e | |
parent | bf45d44c3cda7dac3803a357651a9e9d7bf78da7 (diff) | |
download | openttd-59be733b1b3ae8f67c2279ab1ffb1a4fa452d66c.tar.xz |
(svn r15248) -Fix [FS#2561]: we require v->cur_speed to be zero for wagons and non-front engines
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 11 |
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) { |