Loading

Paste #pbx3m0hab

  1. Index: src/saveload/company_sl.cpp
  2. ===================================================================
  3. --- src/saveload/company_sl.cpp (revision 27201)
  4. +++ src/saveload/company_sl.cpp (working copy)
  5. @@ -141,7 +141,7 @@
  6.  
  7.             case MP_STATION:
  8.                 c = Company::GetIfValid(GetTileOwner(tile));
  9. -               if (c != NULL && GetStationType(tile) != STATION_AIRPORT && !IsBuoy(tile)) c->infrastructure.station++;
  10. +               if (c != NULL && GetStationType(tile) != STATION_AIRPORT && !IsBuoy(tile) && !IsDock(tile)) c->infrastructure.station++;
  11.  
  12.                 switch (GetStationType(tile)) {
  13.                     case STATION_RAIL:
  14. @@ -161,6 +161,10 @@
  15.                     }
  16.  
  17.                     case STATION_DOCK:
  18. +                       if (IsDockTile(tile) && !HasTileWaterGround(tile)) {
  19. +                           if (c != NULL) c->infrastructure.station += 2;
  20. +                       }
  21. +
  22.                     case STATION_BUOY:
  23.                         if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
  24.                             if (c != NULL) c->infrastructure.water++;
  25. Index: src/station_cmd.cpp
  26. ===================================================================
  27. --- src/station_cmd.cpp (revision 27201)
  28. +++ src/station_cmd.cpp (working copy)
  29. @@ -2509,12 +2509,8 @@
  30.  
  31.     if (IsBridgeAbove(tile_cur)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
  32.  
  33. -   /* Get the water class of the water tile before it is cleared.*/
  34.     WaterClass wc = GetWaterClass(tile_cur);
  35.  
  36. -   ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
  37. -   if (ret.Failed()) return ret;
  38. -
  39.     tile_cur += TileOffsByDiagDir(direction);
  40.     if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
  41.         return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  42. @@ -2542,11 +2538,6 @@
  43.  
  44.         st->rect.BeforeAddRect(dock_area.tile, dock_area.w, dock_area.h, StationRect::ADD_TRY);
  45.  
  46. -       /* If the water part of the dock is on a canal, update infrastructure counts.
  47. -        * This is needed as we've unconditionally cleared that tile before. */
  48. -       if (wc == WATER_CLASS_CANAL) {
  49. -           Company::Get(st->owner)->infrastructure.water++;
  50. -       }
  51.         Company::Get(st->owner)->infrastructure.station += 2;
  52.         DirtyCompanyInfrastructureWindows(st->owner);
  53.  
  54. @@ -2587,7 +2578,7 @@
  55.     if (flags & DC_EXEC) {
  56.         DoClearSquare(tile1);
  57.         MarkTileDirtyByTile(tile1);
  58. -       MakeWaterKeepingClass(tile2, st->owner);
  59. +       MakeWaterKeepingClass(tile2, GetTileOwner(tile2));
  60.  
  61.         st->rect.AfterRemoveTile(st, tile1);
  62.         st->rect.AfterRemoveTile(st, tile2);
  63. Index: src/station_map.h
  64. ===================================================================
  65. --- src/station_map.h   (revision 27201)
  66. +++ src/station_map.h   (working copy)
  67. @@ -650,7 +650,7 @@
  68.  static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
  69.  {
  70.     MakeStation(t, o, sid, STATION_DOCK, d);
  71. -   MakeStation(t + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
  72. +   MakeStation(t + TileOffsByDiagDir(d), IsWaterTile(t + TileOffsByDiagDir(d)) ? GetTileOwner (t + TileOffsByDiagDir(d)) : o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
  73.  }
  74.  
  75.  /**

Version history

Revision # Author Created at
p9jdi4m0u Anonymous 22 Mar 2015, 20:24:01 UTC Diff

Comments