(svn r21862) -Codechange: Unify subtype handling between road vehicles and trains.

This commit is contained in:
terkhen
2011-01-19 20:04:09 +00:00
parent be44f1306f
commit d426906a01
5 changed files with 127 additions and 145 deletions

View File

@@ -308,6 +308,23 @@ void AfterLoadVehicles(bool part_of_load)
}
}
if (IsSavegameVersionBefore(157)) {
/* The road vehicle subtype was converted to a flag. */
RoadVehicle *rv;
FOR_ALL_ROADVEHICLES(rv) {
if (rv->subtype == 0) {
/* The road vehicle is at the front. */
rv->SetFrontEngine();
} else if (rv->subtype == 1) {
/* The road vehicle is an articulated part. */
rv->subtype = 0;
rv->SetArticulatedPart();
} else {
NOT_REACHED();
}
}
}
CheckValidVehicles();
FOR_ALL_VEHICLES(v) {