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

openttd_version: OpenTTD var 21/1A result has changed since OpenTTD moved to git #80

Closed
andythenorth opened this issue Feb 10, 2020 · 8 comments

Comments

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Feb 10, 2020

See https://newgrf-specs.tt-wiki.net/wiki/GlobalVariables#OpenTTD_Version_.2821_.2F_A1.29

When OpenTTD was versioned using SVN the lower bits of var 21/A1 contained the SVN revision. Since OpenTTD 1.9 these bits are unused.

nml has openttd_version var. It also has a built-in function version_openttd(MAJOR, MINOR, BUILD, REVISION) which can test for a specific svn version of OpenTTD. That won't return valid results with OpenTTD >= 1.9

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 10, 2020

The SVN revision bits are frozen to one past the last SVN revision number, they are not zero.
There are also AI and GS that depend on the version number, repurposing it will at the very least need to make sure it remains greater than the final SVN revision.

@andythenorth
Copy link
Contributor Author

@andythenorth andythenorth commented Feb 10, 2020

So is any change needed, other than updating nml docs?

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 10, 2020

I doubt it. See also OpenTTD/OpenTTD#6843

@andythenorth
Copy link
Contributor Author

@andythenorth andythenorth commented Feb 16, 2020

So note here that svn version is no longer useful after a specific OpenTTD rev (which?) https://newgrf-specs.tt-wiki.net/wiki/NML:General

@planetmaker
Copy link
Contributor

@planetmaker planetmaker commented Feb 17, 2020

r28004 seems the last SVN rev. I added as much to the wiki... not sure what OpenTTD code says though.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 18, 2020

@andythenorth
Copy link
Contributor Author

@andythenorth andythenorth commented Feb 18, 2020

Thanks, so the nml docs are accurate "only valid until OpenTTD r28004 / 1.9.0. In later versions the revision is fixed". The wording there could be improved for clarity, I'll do that now.

@andythenorth
Copy link
Contributor Author

@andythenorth andythenorth commented Feb 18, 2020

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.