Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Incorrect error printed when using loop-values

Open TheLimeGlass opened this issue 2 years ago • 4 comments

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

Untitled

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.

TheLimeGlass avatar Jan 03 '24 17:01 TheLimeGlass

I think it's being parsed as (loop-value) - 1 which causes this error.

AyhamAl-Ali avatar Jan 03 '24 18:01 AyhamAl-Ali

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. image

sovdeeth avatar Jan 05 '24 01:01 sovdeeth

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.

AyhamAl-Ali avatar Jan 05 '24 12:01 AyhamAl-Ali

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.

APickledWalrus avatar Feb 01 '24 17:02 APickledWalrus