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

Add: allow use of switches and random switches as procedures #66

Merged
merged 7 commits into from Dec 29, 2019

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Nov 24, 2019

NFO output seems correct, but ID handling and generation needs work. For now 2 different procedures can have the same ID.
Work probably needed in other areas too. That's why it's a draft.

Feel free to add commits in my branch.

@andythenorth
Copy link
Contributor

I've tested this with a single stored procedure in Iron Horse.
Branch is https://github.com/andythenorth/iron-horse/tree/stored-procedure-test-haulage-speed-bonus

This replaces global-switch-and-registers with checking a procedure result. It makes more readable code. It's not a very interesting test case but eh. Appears to work.

@glx22 glx22 marked this pull request as ready for review December 18, 2019 18:22
@glx22
Copy link
Contributor Author

glx22 commented Dec 18, 2019

I think it's ready now.

nml/expression/array.py Outdated Show resolved Hide resolved
nml/expression/bitmask.py Outdated Show resolved Hide resolved
@andythenorth
Copy link
Contributor

One final +1: I have converted Iron Horse to use procedures widely, and have compiled hundreds of times now using nmlc built with this PR. Zero issues so far.

@LordAro LordAro merged commit 862c1c3 into OpenTTD:master Dec 29, 2019
@glx22 glx22 deleted the procedure branch December 29, 2019 16:47
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

Successfully merging this pull request may close these issues.

None yet

5 participants