-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
adds delay checks to input key syntaxes #7392
adds delay checks to input key syntaxes #7392
Conversation
ExprCurrentInputKeys does not need delay checking. setTime already checks for delays at parse time. |
This is not about parse time checks, it's about runtime checks. SetTime isn't useful here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is room for improvement in this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems okay. I'm not sure if we actually need to reference the isDelayed
(from parse time) state at runtime. It might be more reliable to only check Delay.isDelayed
(in case the delay did not actually occur)
Description
Adds checks in CondIsPressingKey and ExprCurrentInputKeys to check whether there's a delay prior to the syntax.
If so, it will use the player's current input keys rather than the event keys.
This is only a partial fix for #7388. The bigger issue is that while loops do not take into account their own contents when determining whether to parse the condition as delayed or not. This can't be fixed by simply loading the section before parsing the condition, as the first execution may be undelayed and crucial to the code:if we say that the condition is NOT delayed, then it infinitely loops when pressing forwardif we say the condition MIGHT BE delayed, then it will not pass (because it's checking the keys prior to the event)
The prior issue was fixed via use of
Delay.isDelayed()
, but that has its own issues detailed in #7393. The follow code will never send the "2: " messages:However, there's no easy fix at this time other than reworking the isDelayed api to integrate structures into the logic, so this works as a stop-gap measure.
Target Minecraft Versions: any
Requirements: none
Related Issues: #7388