summaryrefslogtreecommitdiff
path: root/vehicle.h
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle.h')
-rw-r--r--vehicle.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vehicle.h b/vehicle.h
index 2a069e8b1..8c626908a 100644
--- a/vehicle.h
+++ b/vehicle.h
@@ -376,6 +376,14 @@ static inline Vehicle *GetVehicle(uint index)
return &_vehicles[index];
}
+static inline bool IsVehicleIndex(uint index)
+{
+ if (index < _vehicles_size)
+ return true;
+ else
+ return false;
+}
+
#define FOR_ALL_VEHICLES(v) for(v = _vehicles; v != &_vehicles[_vehicles_size]; v++)
#define FOR_ALL_VEHICLES_FROM(v, from) for(v = GetVehicle(from); v != &_vehicles[_vehicles_size]; v++)