vehicle.c
changeset 4734 20770a208a04
parent 4728 cdc127bf9ac4
child 4736 b830a9f1703c
--- a/vehicle.c	Thu Oct 05 02:29:01 2006 +0000
+++ b/vehicle.c	Thu Oct 05 08:15:51 2006 +0000
@@ -2439,6 +2439,18 @@
 	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) {