tunnelbridge_cmd.c
changeset 4087 5ae6c880d66c
parent 4077 d3022f976946
child 4156 0292b2b52e03
--- a/tunnelbridge_cmd.c	Wed Jun 28 13:08:40 2006 +0000
+++ b/tunnelbridge_cmd.c	Wed Jun 28 17:33:04 2006 +0000
@@ -637,7 +637,7 @@
 				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 @@
 					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 @@
 				} 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]);
 					}