From a6a9968d16bb4af600e559e8fa1ed918fdb7827d Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 29 Aug 2007 20:50:58 +0000 Subject: (svn r10997) -Codechange: unify the vehicle view window. Patch by PhilSophus. --- src/vehicle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/vehicle.cpp') 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. -- cgit v1.2.3-70-g09d2