Change: Use vector/iterators/algorithms instead of C-array/loops for NewGRF classes.

This commit is contained in:
2024-04-09 17:54:42 +01:00
committed by Peter Nelson
parent 34758d0921
commit 052f421327
4 changed files with 35 additions and 58 deletions

View File

@@ -546,7 +546,7 @@ public:
if (change_class) {
/* If that fails, select the first available airport
* from the first class where airports are available. */
for (AirportClassID j = APC_BEGIN; j < APC_MAX; j++) {
for (AirportClassID j = APC_BEGIN; j < AirportClass::GetClassCount(); j++) {
AirportClass *apclass = AirportClass::Get(j);
for (uint i = 0; i < apclass->GetSpecCount(); i++) {
const AirportSpec *as = apclass->GetSpec(i);