(svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types

This commit is contained in:
smatz
2009-05-26 22:10:13 +00:00
parent aa546e513f
commit 7ee882d03f
15 changed files with 150 additions and 135 deletions

View File

@@ -28,8 +28,9 @@
if (!IsValidVehicle(vehicle_id)) return -1;
int num = 1;
if (::Vehicle::Get(vehicle_id)->type == VEH_TRAIN) {
const Train *v = (Train *)::Vehicle::Get(vehicle_id);
const Train *v = ::Train::GetIfValid(vehicle_id);
if (v != NULL) {
while ((v = GetNextUnit(v)) != NULL) num++;
}