diff options
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 629123686..384ef4bd0 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -868,12 +868,14 @@ static TrackStatus GetTileTrackStatus_Industry(TileIndex tile, TransportType mod return 0; } -static void GetProducedCargo_Industry(TileIndex tile, CargoID *b) +static void AddProducedCargo_Industry(TileIndex tile, AcceptedCargo ac) { const Industry *i = GetIndustryByTile(tile); - b[0] = i->produced_cargo[0]; - b[1] = i->produced_cargo[1]; + for (uint j = 0; j < lengthof(i->produced_cargo); j++) { + CargoID cargo = i->produced_cargo[j]; + if (cargo != CT_INVALID) ac[cargo]++; + } } static void ChangeTileOwner_Industry(TileIndex tile, Owner old_owner, Owner new_owner) @@ -2417,7 +2419,7 @@ extern const TileTypeProcs _tile_type_industry_procs = { AnimateTile_Industry, // animate_tile_proc TileLoop_Industry, // tile_loop_proc ChangeTileOwner_Industry, // change_tile_owner_proc - GetProducedCargo_Industry, // get_produced_cargo_proc + AddProducedCargo_Industry, // add_produced_cargo_proc NULL, // vehicle_enter_tile_proc GetFoundation_Industry, // get_foundation_proc TerraformTile_Industry, // terraform_tile_proc |