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

Remove: artificial "random" limit on number of statically loaded NewGRFs #9431

Merged
merged 1 commit into from Jul 11, 2021

Conversation

@rubidium42
Copy link
Contributor

@rubidium42 rubidium42 commented Jul 11, 2021

Motivation / Problem

Playing with #9428 I noticed that only an actual 253 NewGRFs could be loaded, so I concluded that MAX_GRF_COUNT must be larger than NETWORK_MAX_GRF_COUNT.

The maximum number of statically loaded NewGRFs is currently limited to 128 minus the number of base set NewGRFs (2) and the number of loaded NewGRFs (2-62), so the number of static NewGRFs is in the range of 64 to 126. With #9428 that would be changed from 2 - 253.

It makes little sense to limit the number of statically loaded NewGRFs, except for when thinking about the insanity of the players. Previously this was an index into a statically allocated array of loaded files, but now this is all dynamic there is no practical limit on them anymore.

Description

Get rid of the artificial limitation on the number of static NewGRFs loaded. It adds no real purpose, and enforcing is would add more logic that is essentially not needed.

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 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')
@rubidium42 rubidium42 changed the title Remove: artificial "random" limit on number of statically loaded NewGRFs Remove: artificial "arbitrary" limit on number of statically loaded NewGRFs Jul 11, 2021
@rubidium42 rubidium42 changed the title Remove: artificial "arbitrary" limit on number of statically loaded NewGRFs Remove: artificial "random" limit on number of statically loaded NewGRFs Jul 11, 2021
@rubidium42 rubidium42 merged commit a498723 into OpenTTD:master Jul 11, 2021
13 checks passed
Loading
@rubidium42 rubidium42 deleted the remove_useless_limit branch Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants