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

Sorted Function throwing internal errors #405

Closed
TheJimmyJ57 opened this issue Feb 27, 2017 · 2 comments
Closed

Sorted Function throwing internal errors #405

TheJimmyJ57 opened this issue Feb 27, 2017 · 2 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.

Comments

@TheJimmyJ57
Copy link

I am trying to use the 'sorted' function to create a /baltop command. It seems to work under only certain conditions and throws internal errors in others. From what I gathered the sorted function throws this error when one number does not have a decimal place (integer) and another number has decimal places. It seems that it does not know how to compare them? This is a code I have been trying that throws errors:

command /test2:
	trigger:
		add 5.02 to {_list::*}
		add 2 to {_list::*}
		add 2304 to {_list::*}
		set {_list2::*} to sorted {_list::*}
		message "%{_list2::*}%"

I have tried on both Skript dev23 and Skript dev24b

@TheBentoBox
Copy link
Member

TheBentoBox commented Feb 27, 2017

Confirmed. It's an issue with casting doubles to longs, which sounds about in line with what you're saying is the cause.

@TheBentoBox TheBentoBox added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Feb 27, 2017
@bensku
Copy link
Member

bensku commented Mar 3, 2017

Nice, you managed to find JVM bug. Arrays.sort doesn't seem to be very reliable :) I'll see if I can hack around this.

bensku added a commit that referenced this issue Mar 4, 2017
@bensku bensku closed this as completed Mar 4, 2017
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.
Projects
None yet
Development

No branches or pull requests

3 participants