Code: Select all
Index: src/water_cmd.cpp
===================================================================
--- src/water_cmd.cpp (revision 27528)
+++ src/water_cmd.cpp (working copy)
@@ -39,6 +39,7 @@
#include "company_base.h"
#include "company_gui.h"
#include "newgrf_generic.h"
+#include "cheat_type.h"
#include "table/strings.h"
@@ -409,7 +410,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 +1234,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 +1242,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 +1314,10 @@
/* Canals can't be terraformed */
if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
+ if (IsWaterTile(tile) && IsRiver(tile)) {
+ if (z_new < 1 && _game_mode == GM_NORMAL && !_cheats.magic_bulldozer.value) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
+ return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_WATER]);
+ }
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
}
To do:
- missing river sprites for these slopes (except those that are tagged 'not missing'):
(0) SLOPE_FLAT - not missing
(1) SLOPE_W
(2) SLOPE_S
(4) SLOPE_E
(8) SLOPE_N
(9) SLOPE_NW - not missing
(3) SLOPE_SW - not missing
(6) SLOPE_SE - not missing
(12) SLOPE_NE - not missing
(5) SLOPE_EW
(10) SLOPE_NS
(11) SLOPE_NWS
(7) SLOPE_WSE
(14) SLOPE_SEN
(13) SLOPE_ENW
(27) SLOPE_STEEP_W
(23) SLOPE_STEEP_S
(30) SLOPE_STEEP_E
(29) SLOPE_STEEP_N