summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-15 20:30:43 +0000
committersmatz <smatz@openttd.org>2007-12-15 20:30:43 +0000
commitf13a60b90cd01c53611c43ac248660f32927417b (patch)
treeb0d471799ca10cc545ba7f0a751829aec9c344a7 /src
parent13c11e9af6f7ddf256970c9be8a095eb1e781b07 (diff)
downloadopenttd-f13a60b90cd01c53611c43ac248660f32927417b.tar.xz
(svn r11639) -Codechange: simplify EnsureNoVehicleOnGround
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 63ffc0927..8074a08b4 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -129,16 +129,6 @@ static void *EnsureNoVehicleProcZ(Vehicle *v, void *data)
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)
{
TileInfo ti;
@@ -149,6 +139,11 @@ Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
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)
{
int x1 = TileX(from);