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

Industry probability differs when set by property versus callback #8311

Closed
2TallTyler opened this issue Sep 20, 2020 · 2 comments
Closed

Industry probability differs when set by property versus callback #8311

2TallTyler opened this issue Sep 20, 2020 · 2 comments

Comments

@2TallTyler
Copy link
Member

OpenTTD/NML provides two ways of setting industry probability: via property and by callback.

The specs say both are range 0..255, but using the same value in otherwise-identical industries results in different industry counts.

I created a test GRF which clearly illustrates this:
https://github.com/2TallTyler/industry_probabilities

Test result in map view

@frosch123
Copy link
Member

First a hint for you: "prob_random" is deprecated and has the same meaning as "prob_map_gen". You probably meant "prob_in_game".

About the issue: This is a bug in OpenTTD. GetScaledIndustryGenerationProbability() treats property and callback differently.

@frosch123 frosch123 transferred this issue from OpenTTD/nml Sep 20, 2020
@2TallTyler
Copy link
Member Author

Thanks, that is indeed what I meant. I've updated the code and confirmed that it does not change the reported behavior.

frosch123 added a commit to frosch123/OpenTTD that referenced this issue Sep 20, 2020
… scaled differently when set via property or callback.
Milek7 added a commit to Milek7/OpenTTD that referenced this issue Dec 15, 2020
…tion was scaled differently when set via property or callback."

This reverts commit df5362a.
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

No branches or pull requests

2 participants