1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 08:59:09 +00:00

(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.

This commit is contained in:
2006-06-28 17:33:04 +00:00
parent b310c78aaa
commit a12c748f5b
5 changed files with 32 additions and 14 deletions

View File

@@ -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]);
}