From bf3811122d1eb1ec3549faf43b9e39bb8ba58cab Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 19 Mar 2006 12:06:12 +0000 Subject: (svn r3979) Move GetRailFoundation() to rail_map.h and use it and friends to get information about rail tiles --- water_cmd.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'water_cmd.c') diff --git a/water_cmd.c b/water_cmd.c index 284aa1084..a67361d63 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -519,14 +519,21 @@ static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs) // make coast.. switch (GetTileType(target)) { case MP_RAILWAY: { - uint slope = GetTileSlope(target, NULL); - byte tracks = GB(_m[target].m5, 0, 6); + TrackBits tracks; + uint slope; + + if (!IsPlainRailTile(tile)) break; + + tracks = GetTrackBits(target); + slope = GetTileSlope(target, NULL); if (!( - (slope == 1 && tracks == 0x20) || - (slope == 2 && tracks == 0x04) || - (slope == 4 && tracks == 0x10) || - (slope == 8 && tracks == 0x08))) + (slope == 1 && tracks == TRACK_BIT_RIGHT) && + (slope == 2 && tracks == TRACK_BIT_UPPER) && + (slope == 4 && tracks == TRACK_BIT_LEFT) && + (slope == 8 && tracks == TRACK_BIT_LOWER) + )) { break; + } } /* FALLTHROUGH */ -- cgit v1.2.3-54-g00ecf