Change: Deliver cargo to the closest industry first (#9536)

This commit is contained in:
dP
2022-02-19 21:08:23 +03:00
committed by GitHub
parent e68bf58989
commit 36bee83864
6 changed files with 60 additions and 26 deletions

View File

@@ -600,9 +600,9 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type,
if (s->cargo_type == cargo_type && s->src_type == src_type && s->src == src && (!s->IsAwarded() || s->awarded == company)) {
switch (s->dst_type) {
case ST_INDUSTRY:
for (Industry *ind : st->industries_near) {
if (s->dst == ind->index) {
assert(ind->part_of_subsidy & POS_DST);
for (const auto &i : st->industries_near) {
if (s->dst == i.industry->index) {
assert(i.industry->part_of_subsidy & POS_DST);
subsidised = true;
if (!s->IsAwarded()) s->AwardTo(company);
}