vehicle.h
changeset 4352 8ddb01bc6075
parent 4346 3f00094f2670
child 4354 684ab9249dae
equal deleted inserted replaced
4351:63ae31104f07 4352:8ddb01bc6075
   373 /**
   373 /**
   374  * Check if an index is a vehicle-index (so between 0 and max-vehicles)
   374  * Check if an index is a vehicle-index (so between 0 and max-vehicles)
   375  *
   375  *
   376  * @return Returns true if the vehicle-id is in range
   376  * @return Returns true if the vehicle-id is in range
   377  */
   377  */
   378 static inline bool IsVehicleIndex(uint index)
   378 static inline bool IsValidVehicleID(uint index)
   379 {
   379 {
   380 	return index < GetVehiclePoolSize();
   380 	return index < GetVehiclePoolSize() && IsValidVehicle(GetVehicle(index));
   381 }
   381 }
   382 
   382 
   383 /* Returns order 'index' of a vehicle or NULL when it doesn't exists */
   383 /* Returns order 'index' of a vehicle or NULL when it doesn't exists */
   384 static inline Order *GetVehicleOrder(const Vehicle *v, int index)
   384 static inline Order *GetVehicleOrder(const Vehicle *v, int index)
   385 {
   385 {