(svn r1583) -Fix: You should no longer be able to delete bridges on any type of underground when there is a vehicle on it

This commit is contained in:
darkvater
2005-01-21 19:52:32 +00:00
parent 5290d5f667
commit 0a944dc950
3 changed files with 24 additions and 16 deletions

View File

@@ -73,17 +73,27 @@ static void *EnsureNoVehicleProcZ(Vehicle *v, void *data)
return v;
}
static inline uint Correct_Z(uint tileh)
{
// needs z correction for slope-type graphics that have the NORTHERN tile lowered
// 1, 2, 3, 4, 5, 6 and 7
return (CORRECT_Z(tileh)) ? 8 : 0;
}
uint GetCorrectTileHeight(TileIndex tile)
{
TileInfo ti;
FindLandscapeHeightByTile(&ti, tile);
return Correct_Z(ti.tileh);
}
bool EnsureNoVehicleZ(TileIndex tile, byte z)
{
TileInfo ti;
FindLandscapeHeightByTile(&ti, tile);
// needs z correction for slope-type graphics that have the NORTHERN tile lowered
// 1, 2, 3, 4, 5, 6 and 7
if (CORRECT_Z(ti.tileh))
z += 8;
ti.z = z;
ti.z = z + Correct_Z(ti.tileh);
return VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ) == NULL;
}