Codechange: Convert IndustryVector to a std::set.

This commit is contained in:
2019-02-24 19:16:24 +00:00
committed by PeterN
parent ed6084523d
commit 94b40fd530
6 changed files with 30 additions and 19 deletions

View File

@@ -596,9 +596,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 (const Industry * const *ip = st->industries_near.Begin(); ip != st->industries_near.End(); ip++) {
if (s->dst == (*ip)->index) {
assert((*ip)->part_of_subsidy & POS_DST);
for (Industry *ind : st->industries_near) {
if (s->dst == ind->index) {
assert(ind->part_of_subsidy & POS_DST);
subsidised = true;
if (!s->IsAwarded()) s->AwardTo(company);
}