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 /rail_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 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 1dd401df6..338742b25 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -1692,20 +1692,20 @@ void SetSignalsOnBothDir(TileIndex tile, byte track) UpdateSignalsOnSegment(tile, _search_dir_2[track]); } -static uint GetSlopeZ_Track(const TileInfo* ti) +static uint GetSlopeZ_Track(TileIndex tile, uint x, uint y) { - Slope tileh = ti->tileh; - uint z = ti->z; + uint z; + Slope tileh = GetTileSlope(tile, &z); if (tileh == SLOPE_FLAT) return z; - if (IsPlainRailTile(ti->tile)) { - uint f = GetRailFoundation(ti->tileh, GetTrackBits(ti->tile)); + if (IsPlainRailTile(tile)) { + uint f = GetRailFoundation(tileh, GetTrackBits(tile)); if (f != 0) { if (f < 15) return z + TILE_HEIGHT; // leveled foundation tileh = _inclined_tileh[f - 15]; // inclined foundation } - return z + GetPartialZ(ti->x & 0xF, ti->y & 0xF, tileh); + return z + GetPartialZ(x & 0xF, y & 0xF, tileh); } else { return z + TILE_HEIGHT; } |