Loops cause havoc when determining possible delays in code #7393
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
priority: medium
Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Skript/Server Version
Bug Description
While loops (and any other looping section) do not accurately represent the possible delay to any syntax within them or in their condition[s]. This is effectively impossible to fix with current API as the first execution of a loop may be undelayed, and specifically need that undelayed state to work, but then the second execution is delayed. The parse-time delay api is not capable of representing this, and as such a runtime api for delays is required.
Expected Behavior
Conditions and syntaxes within while loops should behave accurately according the the delays encountered when running the script.
Steps to Reproduce
This creates an infinite loop, since the CondIsPressingKey does not register that it has been delayed the second time, and as such continues to pull from the event-values.
Fixing this by parsing the condition after loading the loop section instead causes the loop to never run, since the condition will never pull from the event-values and instead gets the keys from before forward is pressed.
Errors or Screenshots
No response
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: