mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use range-for to iterate airport specs to find first available.
parent
2199543fbc
commit
7fb3d1a197
|
@ -537,10 +537,9 @@ public:
|
|||
{
|
||||
/* First try to select an airport in the selected class. */
|
||||
AirportClass *sel_apclass = AirportClass::Get(_selected_airport_class);
|
||||
for (uint i = 0; i < sel_apclass->GetSpecCount(); i++) {
|
||||
const AirportSpec *as = sel_apclass->GetSpec(i);
|
||||
for (const AirportSpec *as : sel_apclass->Specs()) {
|
||||
if (as->IsAvailable()) {
|
||||
this->SelectOtherAirport(i);
|
||||
this->SelectOtherAirport(as->index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue