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

It is possible to run the rescannewgrf command while NewGRFs are being scanned. #8874

James103 opened this issue Mar 19, 2021 · 4 comments
bug priority: low


Copy link

@James103 James103 commented Mar 19, 2021

Version of OpenTTD


Expected result

One or more of the following:

  • When you run the rescannewgrf command, the console loses focus until the command completes.
  • When you run the rescannewgrf command, the command should output an error if it detects that NewGRFs are still being scanned.
  • When you run the rescannewgrf command, the NewGRF scan is cancelled and restarted (@Eddi-z).

Actual result

When you run the rescannewgrf command while newgrfs are still being scanned, the command silently aborts, without printing an error. This may be related to #6589.

Steps to reproduce

  1. Start up the game with several hundred NewGRFs. The more NewGRFs, the easier it is to reproduce.
  2. Pull down the console and run console command clear.
  3. Type rescannewgrf, then hit the Enter key.
  4. As quickly as you can, hit the up arrow key followed by the Enter key.
  5. When the NewGRF scan completes, you should see two or more successive invocations of the rescannewgrf command and no error, even though NewGRFs were only scanned once.
Copy link

@Eddi-z Eddi-z commented Mar 19, 2021

actually, what should happen is that the current scan gets cancelled and restarted.

Copy link

@LordAro LordAro commented Mar 20, 2021

Extremely difficult to cancel a scan in progress. Would require interruptible functions of some sort. Best to just error if it's already in progress, imo

Copy link

@TrueBrain TrueBrain commented Apr 10, 2021

NewGRF scan is already protected not two can run at the same time. The bug here appears to be that the user is not notified of this "I ignored you" :D

@TrueBrain TrueBrain added bug priority: low labels Apr 10, 2021
rubidium42 added a commit to rubidium42/OpenTTD that referenced this issue Apr 11, 2021
Copy link

@rubidium42 rubidium42 commented Apr 11, 2021

Regarding the cancelling of the NewGRF scan; that is, with the current design kind of pointless. The actual scanning runs in the GameLoop thus locking all UI updates, so the second rescannewgrf is either processed before it actually starts the scanning or it is processed after the rescan has been performed. In neither case cancelling is needed.
With #9022 OpenTTD will just show a warning when a NewGRF scan is requested but one is already pending to be done the next GameLoop.

LordAro pushed a commit to LordAro/OpenTTD that referenced this issue Apr 17, 2021
LordAro pushed a commit that referenced this issue Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug priority: low
None yet

No branches or pull requests

5 participants