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 #8874: show a warning when a NewGRF scan is requested multiple times #9022

Merged
merged 1 commit into from Apr 12, 2021

Conversation

rubidium42
Copy link
Contributor

Motivation / Problem

See #8874. Dumping many rescannewgrf commands onto the console will, in the old situation, drop many rescans without notifying the user.

Description

Check whether a NewGRF scan is running before actually requesting a new one. The function to request the scan will return true when a scan was triggered and false when one was already running. In case one was already running, show a warning.

Limitations

Really want to know? ;)

  • the UI is blocked while rescanning, so the suggestion from Eddi-z cannot be done as either the scanning has not started and then there is no need to stop, or the scanning was already done and it will trigger a new scan.
  • now the callback of the first rescan is passed on, instead of the callback of the last rescan request in that tick. This could be solved by making a list of callback, but comes with its own can of worms, and even then someone clicking in the UI and rescanning from the console in the same tick seems unlikely.
  • there is a new message on the console that might mess with bots processing it.

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 affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label Apr 12, 2021
@TrueBrain TrueBrain merged commit c4bccd4 into OpenTTD:master Apr 12, 2021
@rubidium42 rubidium42 deleted the issue-8874 branch April 12, 2021 19:18
LordAro pushed a commit to LordAro/OpenTTD that referenced this pull request Apr 17, 2021
LordAro pushed a commit that referenced this pull request Apr 18, 2021
@LordAro LordAro added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants