Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11261: Set number of items correctly when choosing available airport class #11344

Merged
merged 1 commit into from Oct 3, 2023

Conversation

merni-ns
Copy link
Contributor

@merni-ns merni-ns commented Oct 1, 2023

Motivation / Problem

Fixes #11261.

When the airport building GUI is opened, the game tries to select an available airport in the current class, If not, it loops through classes in order trying to find an available airport, and selects the first available airport it finds and the corresponding class. However, it doesn't set the number of items in the list according to this new class. So only as many items as were in the previous class are clickable.

Description

Set the number of items in the list when changing the airport class due to no airports being available in the selected class.

Also, change the comment to reflect the actual behaviour. It doesn't select a random class, but the first one in order where any airport is available.

Limitations

None?

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@glx22 glx22 merged commit 077b08b into OpenTTD:master Oct 3, 2023
20 checks passed
@merni-ns merni-ns deleted the fix11261 branch October 14, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Airport menu selectability after closing window on a class with no available airports
3 participants