equal
deleted
inserted
replaced
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 { |