(svn r16790) -Add [NoAI]: AIVehicle::GetReliability to get the current reliability of vehicles

This commit is contained in:
yexo
2009-07-10 22:30:38 +00:00
parent bd8f92d3ff
commit f8844424cc
3 changed files with 17 additions and 0 deletions

View File

@@ -425,3 +425,11 @@
Vehicle *v = ::Vehicle::Get(vehicle_id);
return v->orders.list != NULL && v->orders.list->GetNumVehicles() > 1;
}
/* static */ int AIVehicle::GetReliability(VehicleID vehicle_id)
{
if (!IsValidVehicle(vehicle_id)) return -1;
const Vehicle *v = ::Vehicle::Get(vehicle_id);
return v->reliability * 100 >> 16;
}