diff options
author | peter1138 <peter1138@openttd.org> | 2006-06-28 17:33:04 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-06-28 17:33:04 +0000 |
commit | a12c748f5bdab0619e2ac8008aaf9324fe2a6419 (patch) | |
tree | f16b8582d85003e68837e4dd5053ae193f2188d3 /tunnelbridge_cmd.c | |
parent | b310c78aaa7427c538494c3be7a4fea01424e820 (diff) | |
download | openttd-a12c748f5bdab0619e2ac8008aaf9324fe2a6419.tar.xz |
(svn r5403) - Feature: Allow building canals at sea-level, using ctrl to toggle canal or plain water tile. This allows building of non-raisable sea-level water ways (useful in multiplayer) and dikes for low-level areas.
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 079617e4c..5b5ee00b9 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -637,7 +637,7 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags) MarkTileDirtyByTile(tile); } return cost; - } else if (IsWaterUnderBridge(tile) && TilePixelHeight(tile) != 0) { + } else if (IsWaterUnderBridge(tile) && !IsTileOwner(tile, OWNER_WATER)) { /* delete canal under bridge */ // check for vehicles under bridge @@ -710,7 +710,11 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags) DoClearSquare(c); } else { if (GetTileSlope(c, NULL) == SLOPE_FLAT) { - MakeWater(c); + if (IsTileOwner(c, OWNER_WATER)) { + MakeWater(c); + } else { + MakeCanal(c, GetTileOwner(c)); + } } else { MakeShore(c); } @@ -1030,7 +1034,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti) } else { if (ti->tileh == SLOPE_FLAT) { DrawGroundSprite(SPR_FLAT_WATER_TILE); - if (ti->z != 0) DrawCanalWater(ti->tile); + if (ti->z != 0 || !IsTileOwner(ti->tile, OWNER_WATER)) DrawCanalWater(ti->tile); } else { DrawGroundSprite(_water_shore_sprites[ti->tileh]); } |