From 3964b2dd8c49324a12c11ef91b0f592a01c6c0aa Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 23 Jan 2009 23:57:01 +0000 Subject: (svn r15248) -Fix [FS#2561]: we require v->cur_speed to be zero for wagons and non-front engines --- src/saveload/vehicle_sl.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3-54-g00ecf