Merge branch 'master' into jgrpp

# Conflicts:
#	src/industry_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2017-12-10 12:41:58 +00:00
21 changed files with 169 additions and 149 deletions

View File

@@ -492,7 +492,12 @@ static CommandCost ClearTile_Industry(TileIndex tile, DoCommandFlag flags)
return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
}
static void TransportIndustryGoods(TileIndex tile)
/**
* Move produced cargo from industry to nearby stations.
* @param tile Industry tile
* @return true if any cargo was moved.
*/
static bool TransportIndustryGoods(TileIndex tile)
{
Industry *i = Industry::GetByTile(tile);
const IndustrySpec *indspec = GetIndustrySpec(i->type);
@@ -517,16 +522,7 @@ static void TransportIndustryGoods(TileIndex tile)
}
}
if (moved_cargo && !StartStopIndustryTileAnimation(i, IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
if (newgfx != INDUSTRYTILE_NOANIM) {
ResetIndustryConstructionStage(tile);
SetIndustryCompleted(tile);
SetIndustryGfx(tile, newgfx);
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
}
}
return moved_cargo;
}
@@ -811,7 +807,17 @@ static void TileLoop_Industry(TileIndex tile)
if (_game_mode == GM_EDITOR) return;
TransportIndustryGoods(tile);
if (TransportIndustryGoods(tile) && !StartStopIndustryTileAnimation(Industry::GetByTile(tile), IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
if (newgfx != INDUSTRYTILE_NOANIM) {
ResetIndustryConstructionStage(tile);
SetIndustryCompleted(tile);
SetIndustryGfx(tile, newgfx);
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
return;
}
}
if (StartStopIndustryTileAnimation(tile, IAT_TILELOOP)) return;