Loading

Paste #phsigderr

  1. Index: src/industry_cmd.cpp
  2. ===================================================================
  3. --- src/industry_cmd.cpp    (revision 27198)
  4. +++ src/industry_cmd.cpp    (working copy)
  5. @@ -1755,11 +1755,11 @@
  6.             i->location.Add(cur_tile);
  7.  
  8.             WaterClass wc = (IsWaterTile(cur_tile) ? GetWaterClass(cur_tile) : WATER_CLASS_INVALID);
  9. -
  10. +           bool river = HasBit(_me[cur_tile].m6, 0);
  11.             DoCommand(cur_tile, 0, 0, DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR);
  12. -
  13. +           if (river) SB(_me[cur_tile].m6, 0, 1, 1);
  14.             MakeIndustry(cur_tile, i->index, it->gfx, Random(), wc);
  15. -
  16. +          
  17.             if (_generating_world) {
  18.                 SetIndustryConstructionCounter(cur_tile, 3);
  19.                 SetIndustryConstructionStage(cur_tile, 2);
  20. Index: src/station_cmd.cpp
  21. ===================================================================
  22. --- src/station_cmd.cpp (revision 27198)
  23. +++ src/station_cmd.cpp (working copy)
  24. @@ -2511,7 +2511,7 @@
  25.  
  26.     /* Get the water class of the water tile before it is cleared.*/
  27.     WaterClass wc = GetWaterClass(tile_cur);
  28. -
  29. +   bool river = HasBit(_me[tile_cur].m6, 0);
  30.     ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
  31.     if (ret.Failed()) return ret;
  32.  
  33. @@ -2551,7 +2551,7 @@
  34.         DirtyCompanyInfrastructureWindows(st->owner);
  35.  
  36.         MakeDock(tile, st->owner, st->index, direction, wc);
  37. -
  38. +       if (river) SB(_me[tile + TileOffsByDiagDir(direction)].m6, 0, 1, 1);
  39.         st->UpdateVirtCoord();
  40.         UpdateStationAcceptance(st, false);
  41.         st->RecomputeIndustriesNear();
  42. Index: src/water_cmd.cpp
  43. ===================================================================
  44. --- src/water_cmd.cpp   (revision 27198)
  45. +++ src/water_cmd.cpp   (working copy)
  46. @@ -123,6 +123,8 @@
  47.     CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]);
  48.  
  49.     bool add_cost = !IsWaterTile(tile);
  50. +   bool river1 = HasBit(_me[tile].m6, 0);
  51. +   bool river2 = HasBit(_me[tile2].m6, 0);
  52.     CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
  53.     if (ret.Failed()) return ret;
  54.     if (add_cost) {
  55. @@ -145,7 +147,8 @@
  56.         }
  57.         Company::Get(_current_company)->infrastructure.water += 2 * LOCK_DEPOT_TILE_FACTOR;
  58.         DirtyCompanyInfrastructureWindows(_current_company);
  59. -
  60. +       if (river1) SB(_me[tile].m6, 0, 1, 1);
  61. +       if (river2) SB(_me[tile2].m6, 0, 1, 1);
  62.         MakeShipDepot(tile,  _current_company, depot->index, DEPOT_PART_NORTH, axis, wc1);
  63.         MakeShipDepot(tile2, _current_company, depot->index, DEPOT_PART_SOUTH, axis, wc2);
  64.         MarkTileDirtyByTile(tile);
  65. @@ -192,7 +195,7 @@
  66.  
  67.         wc = WATER_CLASS_CANAL;
  68.     }
  69. -
  70. +   bool river = HasBit(_me[tile].m6, 0);
  71.     /* Zero map array and terminate animation */
  72.     DoClearSquare(tile);
  73.  
  74. @@ -199,7 +202,9 @@
  75.     /* Maybe change to water */
  76.     switch (wc) {
  77.         case WATER_CLASS_SEA:   MakeSea(tile);                break;
  78. -       case WATER_CLASS_CANAL: MakeCanal(tile, o, Random()); break;
  79. +       case WATER_CLASS_CANAL: MakeCanal(tile, o, Random());
  80. +           if (river) SB(_me[tile].m6, 0, 1, 1);
  81. +           break;
  82.         case WATER_CLASS_RIVER: MakeRiver(tile, Random());    break;
  83.         default: break;
  84.     }
  85. @@ -231,9 +236,9 @@
  86.             c->infrastructure.water -= 2 * LOCK_DEPOT_TILE_FACTOR;
  87.             DirtyCompanyInfrastructureWindows(c->index);
  88.         }
  89. -
  90.         MakeWaterKeepingClass(tile,  GetTileOwner(tile));
  91.         MakeWaterKeepingClass(tile2, GetTileOwner(tile2));
  92. +
  93.     }
  94.  
  95.     return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_DEPOT_SHIP]);
  96. @@ -291,7 +296,8 @@
  97.     if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) {
  98.         return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
  99.     }
  100. -
  101. +   bool river_lower = HasBit(_me[tile - delta].m6, 0);
  102. +   bool river_upper = HasBit(_me[tile + delta].m6, 0);
  103.     if (flags & DC_EXEC) {
  104.         /* Update company infrastructure counts. */
  105.         Company *c = Company::GetIfValid(_current_company);
  106. @@ -303,7 +309,8 @@
  107.             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.
  108.             DirtyCompanyInfrastructureWindows(_current_company);
  109.         }
  110. -
  111. +       if (river_lower) SB(_me[tile - delta].m6, 0, 1, 1);
  112. +       if (river_upper) SB(_me[tile + delta].m6, 0, 1, 1);
  113.         MakeLock(tile, _current_company, dir, wc_lower, wc_upper, wc_middle);
  114.         MarkTileDirtyByTile(tile);
  115.         MarkTileDirtyByTile(tile - delta);
  116. @@ -352,6 +359,7 @@
  117.         }
  118.         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));
  119.         MakeWaterKeepingClass(tile - delta, GetTileOwner(tile - delta));
  120. +
  121.         MarkCanalsAndRiversAroundDirty(tile);
  122.         MarkCanalsAndRiversAroundDirty(tile - delta);
  123.         MarkCanalsAndRiversAroundDirty(tile + delta);
  124. @@ -419,6 +427,7 @@
  125.         if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
  126.  
  127.         bool water = IsWaterTile(tile);
  128. +       bool river = HasTileWaterClass(tile) && GetWaterClass(tile) == WATER_CLASS_RIVER;
  129.         ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR);
  130.         if (ret.Failed()) return ret;
  131.  
  132. @@ -442,6 +451,7 @@
  133.                     /* FALL THROUGH */
  134.  
  135.                 default:
  136. +                   if (river) SB(_me[tile].m6, 0, 1, 1);
  137.                     MakeCanal(tile, _current_company, Random());
  138.                     if (Company::IsValidID(_current_company)) {
  139.                         Company::Get(_current_company)->infrastructure.water++;
  140. @@ -465,6 +475,7 @@
  141.  
  142.  static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags)
  143.  {
  144. +   bool river = HasBit(_me[tile].m6, 0);
  145.     switch (GetWaterTileType(tile)) {
  146.         case WATER_TILE_CLEAR: {
  147.             if (flags & DC_NO_WATER) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
  148. @@ -492,6 +503,7 @@
  149.                     DirtyCompanyInfrastructureWindows(owner);
  150.                 }
  151.                 DoClearSquare(tile);
  152. +               if (river) MakeRiver(tile, Random());
  153.                 MarkCanalsAndRiversAroundDirty(tile);
  154.             }

Version history

Revision # Author Created at
p0yhrws4t Anonymous 19 Mar 2015, 02:34:41 UTC Diff
pqeuk1r9b Anonymous 18 Mar 2015, 21:39:39 UTC Diff
pg4tog6je Anonymous 18 Mar 2015, 19:06:18 UTC Diff

Comments