summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-11 16:22:07 +0000
committerrubidium <rubidium@openttd.org>2008-06-11 16:22:07 +0000
commit232a2a8e3cdda4a3b8a6a8904a9afc6251aa6a6e (patch)
tree2e00c921b9c02d36ed20ecd34cf8661c157db918 /src
parent58d63ec7265774ce396747f7a23990b3abe9ac9b (diff)
downloadopenttd-232a2a8e3cdda4a3b8a6a8904a9afc6251aa6a6e.tar.xz
(svn r13476) -Fix: draw canal borders for locks and when directly next to a aquaduct entrace but under the aqueduct.
Diffstat (limited to 'src')
-rw-r--r--src/water_cmd.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 71900d8b2..6caa8abf1 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -483,13 +483,19 @@ static bool IsWateredTile(TileIndex tile, Direction from)
{
switch (GetTileType(tile)) {
case MP_WATER:
- if (!IsCoast(tile)) return true;
- switch (GetTileSlope(tile, NULL)) {
- case SLOPE_W: return (from == DIR_SE) || (from == DIR_E) || (from == DIR_NE);
- case SLOPE_S: return (from == DIR_NE) || (from == DIR_N) || (from == DIR_NW);
- case SLOPE_E: return (from == DIR_NW) || (from == DIR_W) || (from == DIR_SW);
- case SLOPE_N: return (from == DIR_SW) || (from == DIR_S) || (from == DIR_SE);
- default: return false;
+ switch (GetWaterTileType(tile)) {
+ default: NOT_REACHED();
+ case WATER_TILE_DEPOT: case WATER_TILE_CLEAR: return true;
+ case WATER_TILE_LOCK: return DiagDirToAxis(GetLockDirection(tile)) == DiagDirToAxis(DirToDiagDir(from));
+
+ case WATER_TILE_COAST:
+ switch (GetTileSlope(tile, NULL)) {
+ case SLOPE_W: return (from == DIR_SE) || (from == DIR_E) || (from == DIR_NE);
+ case SLOPE_S: return (from == DIR_NE) || (from == DIR_N) || (from == DIR_NW);
+ case SLOPE_E: return (from == DIR_NW) || (from == DIR_W) || (from == DIR_SW);
+ case SLOPE_N: return (from == DIR_SW) || (from == DIR_S) || (from == DIR_SE);
+ default: return false;
+ }
}
case MP_RAILWAY:
@@ -507,7 +513,7 @@ static bool IsWateredTile(TileIndex tile, Direction from)
case MP_STATION: return IsOilRig(tile) || (IsDock(tile) && GetTileSlope(tile, NULL) == SLOPE_FLAT) || IsBuoy(tile);
case MP_INDUSTRY: return (GetIndustrySpec(GetIndustryType(tile))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
- case MP_TUNNELBRIDGE: return GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER;
+ case MP_TUNNELBRIDGE: return GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER && ReverseDiagDir(GetTunnelBridgeDirection(tile)) == DirToDiagDir(from);
default: return false;
}
}