Skript

Skript

743k Downloads

Sorted indices expression throws errors when sorting a list with child values

mpschorr opened this issue · 0 comments

commented

Skript/Server Version

[22:49:27 INFO]: [Skript] Server Version: git-Paper-550 (MC: 1.19.4)
[22:49:27 INFO]: [Skript] Skript Version: 2.8.7 (skriptlang-github)
[22:49:27 INFO]: [Skript] Installed Skript Addons: 
[22:49:27 INFO]: [Skript]  - skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders)
[22:49:27 INFO]: [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[22:49:27 INFO]: [Skript]  - skript-yaml v1.5
[22:49:27 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[22:49:27 INFO]: [Skript]  - SkBee v3.5.5 (https://github.com/ShaneBeee/SkBee)
[22:49:27 INFO]: [Skript]  - SkJson v3.0.7 (https://www.skjson.xyz/)
[22:49:27 INFO]: [Skript] Installed dependencies: 
[22:49:27 INFO]: [Skript]  - Vault v1.7.3-b131
[22:49:27 INFO]: [Skript]  - WorldGuard v7.0.8+33cdb4a

Bug Description

Using the "sorted indices" pattern from ExprIndices

"[sorted] (indices|indexes) of %~objects% in (ascending|1¦descending) order",

Throws an internal error when sorting a list with child values, such as {_list::a} having the values {_list::a} = 123 and {_list::a::1} = 321.

Expected Behavior

Expected behavior

  1. Add this script snippet to your server:
command /debug:
    trigger:
        set {_test::1} to 111
        set {_test::2} to 555
        set {_test::3} to 444
        send (sorted indices of {_test::*} in ascending order)
  1. Run /debug
  2. See the expected output of 1, 3, 2

Steps to Reproduce

Bugged behavior

  1. Add this script snippet to your server:
command /debug:
    trigger:
        set {_test::1} to 111
        set {_test::2} to 555
        set {_test::3} to 444
        set {_test::1::a} to 2
        set {_test::2::b} to 3
        set {_test::3::c} to 6
        send (sorted indices of {_test::*} in ascending order)
  1. Run /debug
  2. See error in console

Errors or Screenshots

https://gist.github.com/mpschorr/8c016c197cb9c2dca0ab35be79254c0e

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.