(svn r16718) -Codechange: make IsFreeWagon() member of Train

This commit is contained in:
smatz
2009-07-01 23:49:13 +00:00
parent adc5363202
commit ecfaa0564d
8 changed files with 24 additions and 17 deletions

View File

@@ -20,7 +20,7 @@
/* static */ bool AIVehicle::IsValidVehicle(VehicleID vehicle_id)
{
const Vehicle *v = ::Vehicle::GetIfValid(vehicle_id);
return v != NULL && v->owner == _current_company && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::IsFreeWagon(v)));
return v != NULL && v->owner == _current_company && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()));
}
/* static */ int32 AIVehicle::GetNumWagons(VehicleID vehicle_id)