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 689118bca..15e985889 100644
--- a/vehicle.h
+++ b/vehicle.h
@@ -372,6 +372,14 @@ static inline uint16 GetVehiclePoolSize(void)
#define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)
/**
+ * Check if a Vehicle really exists.
+ */
+static inline bool IsValidVehicle(Vehicle* v)
+{
+ return v->type != 0;
+}
+
+/**
* Check if an index is a vehicle-index (so between 0 and max-vehicles)
*
* @return Returns true if the vehicle-id is in range