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

"stage" in check-staging! is off-by-one #5

Open
xkr47 opened this issue May 14, 2019 · 1 comment
Open

"stage" in check-staging! is off-by-one #5

xkr47 opened this issue May 14, 2019 · 1 comment

Comments

@xkr47
Copy link
Contributor

xkr47 commented May 14, 2019

Here you set stage to one-less-than current stage:

(let [stage (dec (.getCurrentStage (get-control vessel)))

So therefore (last-stage? stage) further down stops progressing stages one stage too early OR if advanced elsewhere, fails to stop advancing stages when it actually reaches the last stage and busyloops next-stage!.

I guess the reason for this was so the stage argument to the next-stage-has-x? functions would be correct.. but I'd like to argue that if a function is called next-stage-x then the function is expected to do the stage argument adjustment itself, otherwise the next- prefix in the function name is not motivated..

@Macroz
Copy link
Owner

Macroz commented May 15, 2019

Yes this is definitely in the one evening coding level so I'm not sure what the stage value should be internally.

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