(svn r10997) -Codechange: unify the vehicle view window. Patch by PhilSophus.

This commit is contained in:
rubidium
2007-08-29 20:50:58 +00:00
parent 97135f2b7e
commit a6a9968d16
13 changed files with 566 additions and 746 deletions

View File

@@ -2145,6 +2145,18 @@ bool IsVehicleInDepot(const Vehicle *v)
return false;
}
bool IsVehicleInDepotStopped(const Vehicle *v)
{
switch (v->type) {
case VEH_TRAIN: return CheckTrainStoppedInDepot(v) >= 0;
case VEH_ROAD: return IsRoadVehInDepotStopped(v);
case VEH_SHIP: return IsShipInDepotStopped(v);
case VEH_AIRCRAFT: return IsAircraftInHangarStopped(v);
default: NOT_REACHED();
}
return false;
}
/**
* Calculates how full a vehicle is.
* @param v The Vehicle to check. For trains, use the first engine.