(svn r10756) -Codechange: use vehicle->IsValid in favour of IsValidVehicle(vehicle).

This commit is contained in:
rubidium
2007-08-02 21:19:07 +00:00
parent db374f600c
commit b15c0efaa9
6 changed files with 13 additions and 19 deletions

View File

@@ -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);
}
}