mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 06:46:43 +00:00
(svn r11639) -Codechange: simplify EnsureNoVehicleOnGround
This commit is contained in:
parent
d0ad7688f2
commit
701e9d27fc
@ -129,16 +129,6 @@ static void *EnsureNoVehicleProcZ(Vehicle *v, void *data)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EnsureNoVehicleOnGround(TileIndex tile)
|
|
||||||
{
|
|
||||||
TileInfo ti;
|
|
||||||
|
|
||||||
ti.tile = tile;
|
|
||||||
ti.z = GetTileMaxZ(tile);
|
|
||||||
return VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ) == NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
|
Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
|
||||||
{
|
{
|
||||||
TileInfo ti;
|
TileInfo ti;
|
||||||
@ -149,6 +139,11 @@ Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
|
|||||||
return (Vehicle*)VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ);
|
return (Vehicle*)VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EnsureNoVehicleOnGround(TileIndex tile)
|
||||||
|
{
|
||||||
|
return FindVehicleOnTileZ(tile, GetTileMaxZ(tile)) == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed)
|
Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed)
|
||||||
{
|
{
|
||||||
int x1 = TileX(from);
|
int x1 = TileX(from);
|
||||||
|
Loading…
Reference in New Issue
Block a user