Loading

Paste #phizsmaeo

  1. Index: src/industry_cmd.cpp
  2. ===================================================================
  3. --- src/industry_cmd.cpp    (revision 27931)
  4. +++ src/industry_cmd.cpp    (working copy)
  5. @@ -491,7 +491,12 @@
  6.     return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
  7.  }
  8.  
  9. -static void TransportIndustryGoods(TileIndex tile)
  10. +/**
  11. + * Move produced cargo from industry to nearby stations.
  12. + * @param tile Industry tile
  13. + * @return true if any cargo was moved.
  14. + */
  15. +static bool TransportIndustryGoods(TileIndex tile)
  16.  {
  17.     Industry *i = Industry::GetByTile(tile);
  18.     const IndustrySpec *indspec = GetIndustrySpec(i->type);
  19. @@ -516,16 +521,7 @@
  20.         }
  21.     }
  22.  
  23. -   if (moved_cargo && !StartStopIndustryTileAnimation(i, IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
  24. -       uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
  25. -
  26. -       if (newgfx != INDUSTRYTILE_NOANIM) {
  27. -           ResetIndustryConstructionStage(tile);
  28. -           SetIndustryCompleted(tile);
  29. -           SetIndustryGfx(tile, newgfx);
  30. -           MarkTileDirtyByTile(tile);
  31. -       }
  32. -   }
  33. +   return moved_cargo;
  34.  }
  35.  
  36.  
  37. @@ -810,8 +806,18 @@
  38.  
  39.     if (_game_mode == GM_EDITOR) return;
  40.  
  41. -   TransportIndustryGoods(tile);
  42. +   if (TransportIndustryGoods(tile) && !StartStopIndustryTileAnimation(Industry::GetByTile(tile), IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
  43. +       uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
  44.  
  45. +       if (newgfx != INDUSTRYTILE_NOANIM) {
  46. +           ResetIndustryConstructionStage(tile);
  47. +           SetIndustryCompleted(tile);
  48. +           SetIndustryGfx(tile, newgfx);
  49. +           MarkTileDirtyByTile(tile);
  50. +           return;
  51. +       }
  52. +   }
  53. +
  54.     if (StartStopIndustryTileAnimation(tile, IAT_TILELOOP)) return;
  55.  
  56.     IndustryGfx newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_next;
  57.  

Comments