Mercurial > hg > openttd
changeset 8078:dcb1301e8c28 draft
(svn r11639) -Codechange: simplify EnsureNoVehicleOnGround
author | smatz <smatz@openttd.org> |
---|---|
date | Sat, 15 Dec 2007 20:30:43 +0000 |
parents | ca41f364c9f6 |
children | a067d4494bfa |
files | src/vehicle.cpp |
diffstat | 1 files changed, 5 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -129,16 +129,6 @@ 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 @@ 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);