diff options
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index fbc061c62..86a87c5c6 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -332,7 +332,7 @@ Vehicle *ForceAllocateSpecialVehicle() if (v->index >= (1 << Vehicle_POOL_BLOCK_SIZE_BITS) * BLOCKS_FOR_SPECIAL_VEHICLES) return NULL; - if (!IsValidVehicle(v)) return InitializeVehicle(v); + if (!v->IsValid()) return InitializeVehicle(v); } return NULL; @@ -358,7 +358,7 @@ static Vehicle *AllocateSingleVehicle(VehicleID *skip_vehicles) if (*skip_vehicles < (_Vehicle_pool.GetSize() - offset)) { // make sure the offset in the array is not larger than the array itself for (v = GetVehicle(offset + *skip_vehicles); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) { (*skip_vehicles)++; - if (!IsValidVehicle(v)) return InitializeVehicle(v); + if (!v->IsValid()) return InitializeVehicle(v); } } |