summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-26 19:29:20 +0000
committerrubidium <rubidium@openttd.org>2010-08-26 19:29:20 +0000
commit08a41c6ee5f1500fcd472e953b2341ef996cb901 (patch)
tree5a6b472d492733b8747c3b02d7421190d6b08bce /src/water_cmd.cpp
parent327451e820fb4429806e4bcfa2ed824ea3858f5a (diff)
downloadopenttd-08a41c6ee5f1500fcd472e953b2341ef996cb901.tar.xz
(svn r20631) -Codechange: generalise IsIndustryTileOnWater + simplify so related code
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 78d190d69..74483f7ca 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -497,7 +497,7 @@ static bool IsWateredTile(TileIndex tile, Direction from)
if ((IsTileType(src_tile, MP_STATION) && IsOilRig(src_tile)) ||
(IsTileType(src_tile, MP_INDUSTRY) && GetIndustryIndex(src_tile) == GetIndustryIndex(tile))) return true;
- return IsIndustryTileOnWater(tile);
+ return IsTileOnWater(tile);
}
case MP_TUNNELBRIDGE: return GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER && ReverseDiagDir(GetTunnelBridgeDirection(tile)) == DirToDiagDir(from);
@@ -932,9 +932,11 @@ FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
if (IsCoast(tile)) {
Slope tileh = GetTileSlope(tile, NULL);
return (IsSlopeWithOneCornerRaised(tileh) ? FLOOD_ACTIVE : FLOOD_DRYUP);
- } else {
- return (GetWaterClass(tile) == WATER_CLASS_SEA) ? FLOOD_ACTIVE : FLOOD_NONE;
}
+ /* FALL THROUGH */
+ case MP_STATION:
+ case MP_INDUSTRY:
+ return (GetWaterClass(tile) == WATER_CLASS_SEA) ? FLOOD_ACTIVE : FLOOD_NONE;
case MP_RAILWAY:
if (GetRailGroundType(tile) == RAIL_GROUND_WATER) {
@@ -945,15 +947,6 @@ FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
case MP_TREES:
return (GetTreeGround(tile) == TREE_GROUND_SHORE ? FLOOD_DRYUP : FLOOD_NONE);
- case MP_STATION:
- if (IsBuoy(tile) || (IsDock(tile) && GetTileSlope(tile, NULL) == SLOPE_FLAT) || IsOilRig(tile)) {
- return (GetWaterClass(tile) == WATER_CLASS_SEA ? FLOOD_ACTIVE : FLOOD_NONE);
- }
- return FLOOD_NONE;
-
- case MP_INDUSTRY:
- return ((IsIndustryTileOnWater(tile) && GetWaterClass(tile) == WATER_CLASS_SEA) ? FLOOD_ACTIVE : FLOOD_NONE);
-
default:
return FLOOD_NONE;
}