diff options
author | tron <tron@openttd.org> | 2006-08-06 16:32:49 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-08-06 16:32:49 +0000 |
commit | 3254155930feb807f81031ebfdc9acedbe33745e (patch) | |
tree | f588dd076c3c98d0c2983a7f5c9e5f5dcbc4447b /unmovable_cmd.c | |
parent | 7c9165827eb64c74efbad0198e97fe1a77fdb258 (diff) | |
download | openttd-3254155930feb807f81031ebfdc9acedbe33745e.tar.xz |
(svn r5794) Pass the TileIndex plus x and y coordinates into GetSlopeZ_* instead of a TileInfo
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r-- | unmovable_cmd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c index 7da836041..0188900e6 100644 --- a/unmovable_cmd.c +++ b/unmovable_cmd.c @@ -176,12 +176,15 @@ static void DrawTile_Unmovable(TileInfo *ti) } } -static uint GetSlopeZ_Unmovable(const TileInfo* ti) +static uint GetSlopeZ_Unmovable(TileIndex tile, uint x, uint y) { - if (IsOwnedLand(ti->tile)) { - return ti->z + GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh); + if (IsOwnedLand(tile)) { + uint z; + uint tileh = GetTileSlope(tile, &z); + + return z + GetPartialZ(x & 0xF, y & 0xF, tileh); } else { - return ti->z + (ti->tileh == SLOPE_FLAT ? 0 : TILE_HEIGHT); + return GetTileMaxZ(tile); } } |