Skip to content
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

Expression 'decimals between' totally incorrect #3494

Closed
Romitou opened this issue Oct 26, 2020 · 4 comments · Fixed by #3495
Closed

Expression 'decimals between' totally incorrect #3494

Romitou opened this issue Oct 26, 2020 · 4 comments · Fixed by #3495
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@Romitou
Copy link
Member

Romitou commented Oct 26, 2020

Description

Using the [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number% expression, more precisely decimals from %number% to %number%, the returned values are totally incorrect.

Steps to Reproduce

Here is the code used.

command test:
    trigger:
        loop decimals from 3.0 to 4.0:
            broadcast "%loop-number%"

Here is the result in the console.

6
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9

Expected Behavior

The expression should have returned correct values.

3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9

Errors / Screenshots

No errors.
image

Server Information

  • Server version/platform: 1.16.2 - git-Paper-182
  • Skript version: 2.5.1
@Romitou
Copy link
Member Author

Romitou commented Oct 26, 2020

If I use the example from the documentation, - loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4 -, here is the result:

7.88
7.89
7.9
7.91
7.92
7.93

@ShaneBeee ShaneBeee added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Oct 26, 2020
@ShaneBeee
Copy link
Contributor

ShaneBeee commented Oct 26, 2020

Tested and can confirm

@bluelhf Im calling you in on this one, you wrote the decimals thing right?!?!

@TheBentoBox
Copy link
Member

Seems like it's starting from double the intended value, then past that is counting appropriately from that point.

@TheBentoBox
Copy link
Member

Seems like this line may be the issue? It's adding the start value to the current value in the iterator's next() which would cause it to start off at double the value.

@ShaneBeee ShaneBeee added the completed The issue has been fully resolved and the change will be in the next Skript update. label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants