diff options
author | yexo <yexo@openttd.org> | 2010-08-07 20:11:27 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-07 20:11:27 +0000 |
commit | e80f3390863aa4a722b0d7516cca7420b12df53a (patch) | |
tree | 6696408aa41b164d70f99c01ef97ee11a364ae1b /src/economy.cpp | |
parent | 50fe2264ec43f72648518ea18551c851624396fd (diff) | |
download | openttd-e80f3390863aa4a722b0d7516cca7420b12df53a.tar.xz |
(svn r20396) -Codechange: introduce a helper function to test whether an industry temporarily refues to accept some cargo
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index dcf7d3990..73b288763 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -909,8 +909,6 @@ static uint DeliverGoodsToIndustry(const Station *st, CargoID cargo_type, uint n Industry *ind = st->industries_near[i]; if (ind->index == source) continue; - const IndustrySpec *indspec = GetIndustrySpec(ind->type); - uint cargo_index; for (cargo_index = 0; cargo_index < lengthof(ind->accepts_cargo); cargo_index++) { if (cargo_type == ind->accepts_cargo[cargo_index]) break; @@ -919,10 +917,7 @@ static uint DeliverGoodsToIndustry(const Station *st, CargoID cargo_type, uint n if (cargo_index >= lengthof(ind->accepts_cargo)) continue; /* Check if industry temporarily refuses acceptance */ - if (HasBit(indspec->callback_mask, CBM_IND_REFUSE_CARGO)) { - uint16 res = GetIndustryCallback(CBID_INDUSTRY_REFUSE_CARGO, 0, GetReverseCargoTranslation(cargo_type, indspec->grf_prop.grffile), ind, ind->type, ind->location.tile); - if (res == 0) continue; - } + if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) continue; /* Insert the industry into _cargo_delivery_destinations, if not yet contained */ _cargo_delivery_destinations.Include(ind); |