@@ -372,15 +372,15 @@ static inline bool IsValidVehicle(const
/**
* Check if an index is a vehicle-index (so between 0 and max-vehicles)
*
* @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 */
static inline Order *GetVehicleOrder(const Vehicle *v, int index)
Order *order = v->orders;