summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 469d935e9..44c7221a8 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -2439,6 +2439,18 @@ int32 SendAllVehiclesToDepot(byte type, uint32 flags, bool service, PlayerID own
return (flags & DC_EXEC) ? 0 : CMD_ERROR;
}
+bool IsVehicleInDepot(const Vehicle *v)
+{
+ switch (v->type) {
+ case VEH_Train: return CheckTrainInDepot(v, false) != -1;
+ case VEH_Road: return IsRoadVehInDepot(v);
+ case VEH_Ship: return IsShipInDepot(v);
+ case VEH_Aircraft: return IsAircraftInHangar(v);
+ default: NOT_REACHED();
+ }
+ return false;
+}
+
void VehicleEnterDepot(Vehicle *v)
{
switch (v->type) {