diff options
author | rubidium <rubidium@openttd.org> | 2007-08-29 20:50:58 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-29 20:50:58 +0000 |
commit | 5d628e6135267c2f72af07fab15cbdadfca41d91 (patch) | |
tree | 90be9332cafc06c8d6987997a1cd3abd742a1118 /src/vehicle.cpp | |
parent | e10361a0eb0e84554a6d519af5b2c1206cbbf242 (diff) | |
download | openttd-5d628e6135267c2f72af07fab15cbdadfca41d91.tar.xz |
(svn r10997) -Codechange: unify the vehicle view window. Patch by PhilSophus.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 6cb690226..d3bb464f8 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -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. |