adds delay checks to input key syntaxes #7392
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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