(svn r18726) -Fix [FS#3463]: with non-uniform industries the 'supplies' text when building a station could be incorrect (missing a cargo)

-Change [NoAI]: AITile::GetCargoProduction now returns the number of producers and not the number of tiles of producers.
-Fix [NoAI]: AITileList_IndustryProducing would omit some tiles for at which a station would get cargo.
This commit is contained in:
rubidium
2010-01-04 21:10:20 +00:00
parent 1ed599f5cf
commit 28fc7b47bd
8 changed files with 151 additions and 122 deletions

View File

@@ -924,16 +924,6 @@ static TrackStatus GetTileTrackStatus_Industry(TileIndex tile, TransportType mod
return 0;
}
static void AddProducedCargo_Industry(TileIndex tile, CargoArray &produced)
{
const Industry *i = Industry::GetByTile(tile);
for (uint j = 0; j < lengthof(i->produced_cargo); j++) {
CargoID cargo = i->produced_cargo[j];
if (cargo != CT_INVALID) produced[cargo]++;
}
}
static void ChangeTileOwner_Industry(TileIndex tile, Owner old_owner, Owner new_owner)
{
/* If the founder merges, the industry was created by the merged company */
@@ -2468,7 +2458,7 @@ extern const TileTypeProcs _tile_type_industry_procs = {
AnimateTile_Industry, // animate_tile_proc
TileLoop_Industry, // tile_loop_proc
ChangeTileOwner_Industry, // change_tile_owner_proc
AddProducedCargo_Industry, // add_produced_cargo_proc
NULL, // add_produced_cargo_proc
NULL, // vehicle_enter_tile_proc
GetFoundation_Industry, // get_foundation_proc
TerraformTile_Industry, // terraform_tile_proc