Codechange: Use IsValidCargoID/IsValidCargoType.

IsValidCargoType() is used only for unmapped IDs.
This commit is contained in:
Peter Nelson
2023-05-04 11:29:21 +01:00
committed by PeterN
parent c4ca6a0f74
commit 76516d7f70
30 changed files with 130 additions and 134 deletions

View File

@@ -407,7 +407,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 (ind->accepts_cargo[cargo_index] != CT_INVALID) break;
if (IsValidCargoID(ind->accepts_cargo[cargo_index])) break;
}
if (cargo_index >= lengthof(ind->accepts_cargo)) return;