The issue is it should still sort regardless and re order them as Im getting the PR of each entry sorting high to low and pushing back to the turn order..but once you drag a person to a new place. the 'pr' turns to a string.
For example I set initiative for 2 people and log turn order I get:
[{"id":"-JWAEQmyMkuBCLa_d_lb","pr":19},{"id":"-JWAEQ8sNSHHbWvWgurJ","pr":3}]BUT
when I drag the one guy to the top and log turn order it returns this
[{"id":"-JWAEQ8sNSHHbWvWgurJ","pr":"3","custom":""},{"id":"-JWAEQmyMkuBCLa_d_lb","pr":"19","custom":""}]Where the pr is now a string.
Only thing I did to cause the change is drag a turn to a new place.
Its easy to check with this code:
on('chat:message', function (msg) { if (msg.type == 'api' && msg.content.indexOf('!check') !== -1) { order = JSON.parse(Campaign().get("turnorder")); log(order); } });set 2 peoples initiative with the auto add &{tracker}
do !check
drag the bottom guy to the top and do !check
Long as you're not editing the pr should it not stay the same type of variable?