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

This commit is contained in:
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

@@ -1370,9 +1370,9 @@ static void MaybeCrashAirplane(Aircraft *v)
if (GB(Random(), 0, 22) > prob) return;
/* Crash the airplane. Remove all goods stored at the station. */
for (CargoID i = 0; i < NUM_CARGO; i++) {
st->goods[i].rating = 1;
st->goods[i].cargo.Truncate();
for (GoodsEntry &ge : st->goods) {
ge.rating = 1;
ge.cargo.Truncate();
}
CrashAirplane(v);