Codechange: Add IsCargoAccepted/Produced() helpers.

This commit is contained in:
Peter Nelson
2023-05-24 00:52:44 +01:00
committed by PeterN
parent 633f19419d
commit 09408e8e46
9 changed files with 40 additions and 65 deletions

View File

@@ -405,11 +405,7 @@ void Station::AddIndustryToDeliver(Industry *ind, TileIndex tile)
}
/* Include only industries that can accept cargo */
uint cargo_index;
for (cargo_index = 0; cargo_index < lengthof(ind->accepts_cargo); cargo_index++) {
if (IsValidCargoID(ind->accepts_cargo[cargo_index])) break;
}
if (cargo_index >= lengthof(ind->accepts_cargo)) return;
if (!ind->IsCargoAccepted()) return;
this->industries_near.insert(IndustryListEntry{distance, ind});
}