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: [NewGRF] industry variables 65 and 66, object variable 46 #9088

Merged
merged 2 commits into from May 2, 2021

Conversation

frosch123
Copy link
Member

Motivation / Problem

NFO spec and TTDP agree on this behavior:

  • Industry variables 65 and 66 use the parameters as signed tile offset.
  • Industry variable 66 and object variable 46 return no town zone, and use 32bit for the squared euclidian distance. (you can exceed 16bit already on a 256x256 map.)

OTTD contains various copy&paste mistakes that make it differ in the above items.

Description

The variables are fixed.
If a NewGRF would read the townzone from the euclidian-distance variable, it would break.
NewGRF written in NML are not affected (NML read the townzone from the correct variable).
NewGRF written in NFO (if there are any), are likely not affected, if the authors read the specs instead of OTTD source.

Limitations

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')

@frosch123 frosch123 added component: NewGRF This issue is related to NewGRFs backport requested This PR should be backport to current release (RC / stable) labels Apr 23, 2021
glx22
glx22 previously approved these changes Apr 23, 2021
Copy link
Contributor

@glx22 glx22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches the spec now.

@LordAro
Copy link
Member

LordAro commented Apr 24, 2021

I could be super pedantic and ask that the commit message (that already has 2 Fix: .. lines in it) be split into 2 commits :p

@frosch123 frosch123 added needs review: NewGRF Review requested from a NewGRF expert and removed component: NewGRF This issue is related to NewGRFs labels May 1, 2021
@LordAro LordAro merged commit 2cf5df2 into OpenTTD:master May 2, 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 May 3, 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) needs review: NewGRF Review requested from a NewGRF expert
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants