Codechange: Use iterators and/or range-for on cargo related loops.

This commit is contained in:
Peter Nelson
2023-10-18 20:49:01 +01:00
committed by Peter Nelson
parent 2a88e0fab3
commit 9602de474d
16 changed files with 79 additions and 89 deletions

View File

@@ -502,8 +502,8 @@ uint32_t Waypoint::GetNewGRFVariable(const ResolverObject &, byte variable, [[ma
break;
case CT_DEFAULT:
for (CargoID cargo_type = 0; cargo_type < NUM_CARGO; cargo_type++) {
cargo += st->goods[cargo_type].cargo.TotalCount();
for (const GoodsEntry &ge : st->goods) {
cargo += ge.cargo.TotalCount();
}
break;