diff options
author | tron <tron@openttd.org> | 2005-01-17 09:41:46 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-17 09:41:46 +0000 |
commit | fb0c3c8061ef1320fee319756dc4a7e5f58090f1 (patch) | |
tree | 8dc229efa596b250b79a49c52e25faeaf55adc18 /water_cmd.c | |
parent | d4beff7954f1f016ed517b6c54e6a25895f5481d (diff) | |
download | openttd-fb0c3c8061ef1320fee319756dc4a7e5f58090f1.tar.xz |
(svn r1549) Clean up some functions:
uint tile -> TileIndex tile
if () cascade -> switch ()
Diffstat (limited to 'water_cmd.c')
-rw-r--r-- | water_cmd.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/water_cmd.c b/water_cmd.c index e11cc50b9..f3ac23e3a 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -315,19 +315,27 @@ static int32 ClearTile_Water(uint tile, byte flags) { } // return true if a tile is a water tile. -static bool IsWateredTile(uint tile) +static bool IsWateredTile(TileIndex tile) { byte m5 = _map5[tile]; - if (IsTileType(tile, MP_WATER)) { - return m5 != 1; - } else if (IsTileType(tile, MP_STATION)) { - // returns true if it is a dock-station (m5 inside values is m5<75 all stations, - // 83<=m5<=114 new airports - return !(m5 < 75 || (m5 >= 83 && m5 <= 114)); - } else if (IsTileType(tile, MP_TUNNELBRIDGE)) { - return (m5 & 0xF8) == 0xC8; - } else - return false; + + switch (TileType(tile)) { + case MP_WATER: + // true, if not coast/riverbank + return m5 != 1; + + case MP_STATION: + // returns true if it is a dock-station + // m5 inside values is m5 < 75 all stations, 83 <= m5 <= 114 new airports + return !(m5 < 75 || (m5 >= 83 && m5 <= 114)); + + case MP_TUNNELBRIDGE: + // true, if tile is middle part of bridge with water underneath + return (m5 & 0xF8) == 0xC8; + + default: + return false; + } } // draw a canal styled water tile with dikes around |