static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
{
/* Canals can't be terraformed */
if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
/* Rivers can't be terraformed if the resulting formation is not flat or inclined */
if (IsWaterTile(tile) && IsRiver(tile)) {
if (IsTileFlat(tile) && IsInclinedSlope(tileh_new)) {
}
else {
return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
}
}
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
}