Loading

friendly river gen

  1. Index: src/landscape.cpp
  2. ===================================================================
  3. --- src/landscape.cpp   (revision 27795)
  4. +++ src/landscape.cpp   (working copy)
  5. @@ -1008,7 +1008,7 @@
  6.  
  7.     return heightEnd <= heightBegin &&
  8.             /* Slope either is inclined or flat; rivers don't support other slopes. */
  9. -           (slopeEnd == SLOPE_FLAT || IsInclinedSlope(slopeEnd)) &&
  10. +           (slopeEnd == SLOPE_FLAT || (IsInclinedSlope(slopeEnd) && DoCommand(end, 0, 0, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_LOCK)), CMD_BUILD_LOCK).Succeeded())) &&
  11.             /* Slope continues, then it must be lower... or either end must be flat. */
  12.             ((slopeEnd == slopeBegin && heightEnd < heightBegin) || slopeEnd == SLOPE_FLAT || slopeBegin == SLOPE_FLAT);
  13.  }
  14. Index: src/water_cmd.cpp
  15. ===================================================================
  16. --- src/water_cmd.cpp   (revision 27795)
  17. +++ src/water_cmd.cpp   (working copy)
  18. @@ -272,6 +272,8 @@
  19.     if (!IsTileFlat(tile - delta)) {
  20.         return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
  21.     }
  22. +
  23. +   if (DistanceFromEdge(tile - delta) <= 1 || !IsTileFlat(tile - delta - delta)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  24.     WaterClass wc_lower = IsWaterTile(tile - delta) ? GetWaterClass(tile - delta) : WATER_CLASS_CANAL;
  25.  
  26.     /* upper tile */
  27. @@ -284,6 +286,8 @@
  28.     if (!IsTileFlat(tile + delta)) {
  29.         return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
  30.     }
  31. +
  32. +   if (DistanceFromEdge(tile + delta) <= 1 || !IsTileFlat(tile + delta + delta)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  33.     WaterClass wc_upper = IsWaterTile(tile + delta) ? GetWaterClass(tile + delta) : WATER_CLASS_CANAL;
  34.  
  35.     if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) {

Comments