(svn r15248) -Fix [FS#2561]: we require v->cur_speed to be zero for wagons and non-front engines

This commit is contained in:
smatz 2009-01-23 23:57:01 +00:00
parent 3d21639d5b
commit 3964b2dd8c

View File

@ -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) {