summaryrefslogtreecommitdiff
path: root/water_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-19 12:06:12 +0000
committertron <tron@openttd.org>2006-03-19 12:06:12 +0000
commit77e5cf4bc1137805a8e69e6a8ce1370af09dd8d8 (patch)
treeb86bb7662c2be1ce87ebc168346f1677af2a26e4 /water_cmd.c
parentba53ec750a05c8e0e316c8f5838cfad7f9fd13de (diff)
downloadopenttd-77e5cf4bc1137805a8e69e6a8ce1370af09dd8d8.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.c19
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 */