(svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user