Codechange: Use iterators and/or range-for on cargo related loops.
This commit is contained in:

committed by
Peter Nelson

parent
2a88e0fab3
commit
9602de474d
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user