summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 20:50:58 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 20:50:58 +0000
commita6a9968d16bb4af600e559e8fa1ed918fdb7827d (patch)
tree90be9332cafc06c8d6987997a1cd3abd742a1118 /src/vehicle.cpp
parent97135f2b7e46e730bbac53572ec37b68d562ede2 (diff)
downloadopenttd-a6a9968d16bb4af600e559e8fa1ed918fdb7827d.tar.xz
(svn r10997) -Codechange: unify the vehicle view window. Patch by PhilSophus.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp12
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.