Codechange: Use CargoArray::GetCount()

This commit is contained in:
2023-05-23 12:23:50 +01:00
committed by PeterN
parent a6c5b4ce4b
commit 74e42e39a8
2 changed files with 2 additions and 10 deletions

View File

@@ -334,10 +334,7 @@ bool FindSubsidyTownCargoRoute()
/* Passenger subsidies are not handled here. */
town_cargo_produced[CT_PASSENGERS] = 0;
uint8 cargo_count = 0;
for (CargoID i = 0; i < NUM_CARGO; i++) {
if (town_cargo_produced[i] > 0) cargo_count++;
}
uint8 cargo_count = town_cargo_produced.GetCount();
/* No cargo produced at all? */
if (cargo_count == 0) return false;