Skip to content

Commit

Permalink
Fix #11261: Set number of items correctly when choosing available air…
Browse files Browse the repository at this point in the history
…port set (#11344)
  • Loading branch information
merni-ns committed Oct 3, 2023
1 parent 82c8720 commit 077b08b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/airport_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,14 @@ class BuildAirportWindow : public PickerWindowBase {
}
if (change_class) {
/* If that fails, select the first available airport
* from a random class. */
* from the first class where airports are available. */
for (AirportClassID j = APC_BEGIN; j < APC_MAX; j++) {
AirportClass *apclass = AirportClass::Get(j);
for (uint i = 0; i < apclass->GetSpecCount(); i++) {
const AirportSpec *as = apclass->GetSpec(i);
if (as->IsAvailable()) {
_selected_airport_class = j;
this->vscroll->SetCount(apclass->GetSpecCount());
this->SelectOtherAirport(i);
return;
}
Expand Down

0 comments on commit 077b08b

Please sign in to comment.