Index: src/water_cmd.cpp
===================================================================
--- src/water_cmd.cpp (revision 27527)
+++ src/water_cmd.cpp (working copy)
@@ -409,7 +409,7 @@
CommandCost ret;
Slope slope = GetTileSlope(tile);
- if (slope != SLOPE_FLAT && (wc != WATER_CLASS_RIVER || !IsInclinedSlope(slope))) {
+ if (slope != SLOPE_FLAT && wc != WATER_CLASS_RIVER) {
return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
}
@@ -1233,6 +1233,7 @@
static TrackStatus GetTileTrackStatus_Water(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
{
+ static const byte clear_tracks[] = {63, 32, 4, 0, 16, 0, 0, 8, 8, 0, 0, 16, 0, 4, 32, 63};
static const byte coast_tracks[] = {0, 32, 4, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0};
TrackBits ts;
@@ -1240,7 +1241,7 @@
if (mode != TRANSPORT_WATER) return 0;
switch (GetWaterTileType(tile)) {
- case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : TRACK_BIT_NONE; break;
+ case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : (TrackBits)clear_tracks[GetTileSlope(tile) & 0xF]; break;
case WATER_TILE_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile) & 0xF]; break;
case WATER_TILE_LOCK: ts = DiagDirToDiagTrackBits(GetLockDirection(tile)); break;
case WATER_TILE_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
@@ -1312,6 +1313,8 @@
/* Canals can't be terraformed */
if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
+ if (IsWaterTile(tile) && IsRiver(tile)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_WATER]);
+
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
}