CommandHelper

CommandHelper

46.5k Downloads

queue() contents run without order

LadyCailinBot opened this issue · 3 comments

commented

CMDHELPER-2965 - Reported by Алексей.Положенцев

For example, script

/out = >>>
for(@x=0, @x<15, @x++,
queue_push(closure(sys_out(@x))))
<<<

can output "0 2 13 3 10 11 9 12 7 4 14 5 1 6 8"

tested on CH builds #2743 and #2747

commented

Comment by PseudoKnight

I've confirmed this on my server as well. What's odd is that it often outputs the same order of numbers each time.

commented

Comment by LadyCailin

This is an issue in the bukkit scheduler, actually. If you run this from cmdline, it works as expected. I'm not sure if filing a bug in bukkit is worth it, but I think my solution will be to decouple from bukkit, and use the same scheduler in cmdline mode as the server mode.

commented

Comment by LadyCailin

This should be fixed in the latest commits.