summaryrefslogtreecommitdiff
path: root/vehicle.h
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle.h')
-rw-r--r--vehicle.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vehicle.h b/vehicle.h
index 760cfb8ea..6a434a15c 100644
--- a/vehicle.h
+++ b/vehicle.h
@@ -375,9 +375,9 @@ static inline bool IsValidVehicle(const Vehicle *v)
*
* @return Returns true if the vehicle-id is in range
*/
-static inline bool IsVehicleIndex(uint index)
+static inline bool IsValidVehicleID(uint index)
{
- return index < GetVehiclePoolSize();
+ return index < GetVehiclePoolSize() && IsValidVehicle(GetVehicle(index));
}
/* Returns order 'index' of a vehicle or NULL when it doesn't exists */