diff options
author | tron <tron@openttd.org> | 2006-03-19 12:06:12 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-19 12:06:12 +0000 |
commit | bf3811122d1eb1ec3549faf43b9e39bb8ba58cab (patch) | |
tree | b86bb7662c2be1ce87ebc168346f1677af2a26e4 /water_cmd.c | |
parent | 09aabd8ea39ee3dfa99d851412c45197f6c218e2 (diff) | |
download | openttd-bf3811122d1eb1ec3549faf43b9e39bb8ba58cab.tar.xz |
(svn r3979) Move GetRailFoundation() to rail_map.h and use it and friends to get information about rail tiles
Diffstat (limited to 'water_cmd.c')
-rw-r--r-- | water_cmd.c | 19 |
1 files changed, 13 insertions, 6 deletions
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 */ |