(svn r21924) -Codechange: Unify some parts of the articulated vehicle code.

-Cleanup: Avoid conversions to Train and RoadVehicle that are no longer required.
This commit is contained in:
terkhen
2011-01-29 17:30:25 +00:00
parent 50b0e10026
commit 734994c9ba
9 changed files with 26 additions and 56 deletions

View File

@@ -797,7 +797,7 @@ struct DepotWindow : Window {
loaded [w->cargo_type] += w->cargo.Count();
}
if (w->type == VEH_TRAIN && !Train::From(w)->HasArticulatedPart()) {
if (w->type == VEH_TRAIN && !w->HasArticulatedPart()) {
num++;
if (!whole_chain) break;
}
@@ -911,7 +911,7 @@ struct DepotWindow : Window {
} else if (gdvp.wagon == NULL || gdvp.wagon->index != sel) {
this->vehicle_over = INVALID_VEHICLE;
TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head);
} else if (gdvp.head != NULL && Train::From(gdvp.head)->IsFrontEngine()) {
} else if (gdvp.head != NULL && gdvp.head->IsFrontEngine()) {
ShowVehicleViewWindow(gdvp.head);
}
}