Loading

Paste #p9jfcdsya

  1. Index: src/town_cmd.cpp
  2. ===================================================================
  3. --- src/town_cmd.cpp    (revision 27632)
  4. +++ src/town_cmd.cpp    (working copy)
  5. @@ -1044,6 +1044,9 @@
  6.   */
  7.  static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd)
  8.  {
  9. +   /* don't build road on coasts with only one corner raised */
  10. +   if (IsSlopeWithOneCornerRaised(GetTileSlope(tile)) && IsCoastTile(tile)) return false;
  11. +
  12.     if (DoCommand(tile, rcmd, t->index, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD).Succeeded()) {
  13.         _grow_town_result = GROWTH_SUCCEED;
  14.         return true;
  15. @@ -1066,6 +1069,8 @@
  16.     assert(bridge_dir < DIAGDIR_END);
  17.  
  18.     const Slope slope = GetTileSlope(tile);
  19. +   /* don't build a bridge if the source tile is a coast with only one corner raised */
  20. +   if (IsSlopeWithOneCornerRaised(slope) && IsCoastTile(tile)) return false;
  21.  
  22.     /* Make sure the direction is compatible with the slope.
  23.      * Well we check if the slope has an up bit set in the
  24. @@ -1103,6 +1108,9 @@
  25.     /* no water tiles in between? */
  26.     if (bridge_length == 1) return false;
  27.  
  28. +   /* don't build a bridge if the destination tile is a coast with only one corner raised */
  29. +   if (IsSlopeWithOneCornerRaised(GetTileSlope(bridge_tile)) && IsCoastTile(bridge_tile)) return false;
  30. +
  31.     for (uint8 times = 0; times <= 22; times++) {
  32.         byte bridge_type = RandomRange(MAX_BRIDGES - 1);
  33.  
  34. @@ -2066,7 +2074,7 @@
  35.  {
  36.     /* cannot build on these slopes... */
  37.     Slope slope = GetTileSlope(tile);
  38. -   if ((noslope && slope != SLOPE_FLAT) || IsSteepSlope(slope)) return false;
  39. +   if ((noslope && slope != SLOPE_FLAT) || IsSteepSlope(slope) || (IsSlopeWithOneCornerRaised(slope) && IsCoastTile(tile))) return false;
  40.  
  41.     /* building under a bridge? */
  42.     if (IsBridgeAbove(tile)) return false;

Comments