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

Lift out absolute time labels at the beginning of a loop #4

Open
ExpHP opened this issue Jan 14, 2021 · 0 comments
Open

Lift out absolute time labels at the beginning of a loop #4

ExpHP opened this issue Jan 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ExpHP
Copy link
Owner

ExpHP commented Jan 14, 2021

script main {
+1000:
    loop {
0:
        posKeyframe(0.0, 0.0, 0.0);
+10:
    }
}

One might look at this and (not unreasonably) expect that the time at the beginning of the loop body is 0, and therefore, this will wait each iteration after the first time it hits the implicit goto at the end of the loop. However, that goto actually sets the time to 1000, and thus once this enters the loop it will spin infinitely.

We probably want this to be equivalent to:

script main {
+1000:
0:
    loop {
        posKeyframe(0.0, 0.0, 0.0);
+10:
    }
}

(note: +1000: 0: is also a weird thing worth its own discussion, but that's another topic)

@ExpHP ExpHP added the enhancement New feature or request label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant