Incorrect error printed when using loop-values
Skript/Server Version
2.8.0-pre1
1.20.1
Bug Description
When using if distance between y-coordinate of loop-value-2 and y-coordinate of loop-value-1 is greater than 5: the error Skript prints is stating that i'm using the loop-value incorrectly, when in reality I should be using difference not distance.
Expected Behavior
So this should be cannot understand error.
Steps to Reproduce
loop two lists of locations, and use the provided condition if distance between y-coordinate of loop-value-2 and y-coordinate of loop-value-1 is greater than 5:
Errors or Screenshots
Other
Potentially related to the recent loop iteration pull request in 2.8
Agreement
- [X] I have read the guidelines above and affirm I am following them with this report.
I think it's being parsed as (loop-value) - 1 which causes this error.
It does take a hell of a long time to error on my machine too, which I think is due to arithmetic.
The loop-value error is the same on 2.7.3, so I don't think arithmetic changed that, but it is much faster to error.
This usually happens when a possible number returntype is on the left hand and the loop-X-Y is on the right hand which makes Skript thinks it's arithmetic and uses -Y as a math operation which if I am not mistaken has been there for a good time so I don't think it's related to the arithmetic PR but that long parsing time must be investigated.
not sure there is much we can do regarding this specific issue. skript will try to avoid a generic "can't understand this" error by using any other available errors.