Loading

Paste #pywkih1li

  1. Index: src/town_cmd.cpp
  2. ===================================================================
  3. --- src/town_cmd.cpp    (revision 27632)
  4. +++ src/town_cmd.cpp    (working copy)
  5. @@ -871,6 +871,9 @@
  6.     /* Prevent towns from building roads under bridges along the bridge. Looks silly. */
  7.     if (IsBridgeAbove(tile) && GetBridgeAxis(tile) == DiagDirToAxis(dir)) return false;
  8.  
  9. +   /* Prevent towns from building roads where ships can traverse */
  10. +   if ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)) & TRACK_BIT_ALL) != TRACK_BIT_NONE) return false;
  11. +
  12.     /* Check if there already is a road at this point? */
  13.     if (GetTownRoadBits(tile) == ROAD_NONE) {
  14.         /* No, try if we are able to build a road piece there.
  15. @@ -1103,6 +1106,9 @@
  16.     /* no water tiles in between? */
  17.     if (bridge_length == 1) return false;
  18.  
  19. +   /* Don't build the bridge if the bridge head at the destination is traversable by ships */
  20. +   if ((TrackStatusToTrackBits(GetTileTrackStatus(bridge_tile, TRANSPORT_WATER, 0)) & TRACK_BIT_ALL) != TRACK_BIT_NONE) return false;
  21. +
  22.     for (uint8 times = 0; times <= 22; times++) {
  23.         byte bridge_type = RandomRange(MAX_BRIDGES - 1);
  24.  
  25. @@ -1158,6 +1164,7 @@
  26.  
  27.             case TL_3X3_GRID:
  28.             case TL_2X2_GRID:
  29. +               if ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)) & TRACK_BIT_ALL) != TRACK_BIT_NONE) return;
  30.                 rcmd = GetTownRoadGridElement(t1, tile, target_dir);
  31.                 if (rcmd == ROAD_NONE) return;
  32.                 break;
  33. @@ -2066,7 +2073,7 @@
  34.  {
  35.     /* cannot build on these slopes... */
  36.     Slope slope = GetTileSlope(tile);
  37. -   if ((noslope && slope != SLOPE_FLAT) || IsSteepSlope(slope)) return false;
  38. +   if ((noslope && slope != SLOPE_FLAT) || IsSteepSlope(slope) || ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)) & TRACK_BIT_ALL) != TRACK_BIT_NONE)) return false;
  39.  
  40.     /* building under a bridge? */
  41.     if (IsBridgeAbove(tile)) return false;

Version history

Revision # Author Created at
p9jfcdsya Anonymous 03 Sep 2016, 19:10:08 UTC Diff

Comments