Skip to content

Commit 065c3d4

Browse files
committed
fix: sort newest MC asset indexes at the top of the list
1 parent 3c2be30 commit 065c3d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/sound_import/sound_import.gml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ function find_asset_indexes() {
3838
file_find_close();
3939

4040
array_sort(asset_indexes, function(elm1, elm2) {
41-
return ds_list_find_index(sound_import_asset_index_names_sort, elm1) < ds_list_find_index(sound_import_asset_index_names_sort, elm2);
41+
var index1 = ds_list_find_index(sound_import_asset_index_names_sort, elm1)
42+
var index2 = ds_list_find_index(sound_import_asset_index_names_sort, elm2)
43+
if (index1 == -1) return -1; // Sort newer Minecraft versions at the top
44+
if (index2 == -1) return 1;
45+
return index1 < index2;
4246
});
4347

4448
return asset_indexes;

0 commit comments

Comments
 (0)