Fix loader comparison when unrecognized loader is encountered (#372)

Since an unrecognized loader has an index of -1, and since lower number indicate a better loader, an unrecognized loader (when found in b) would immediately be assumed to be a great loader. Since the loop for A properly handles it, B would always be assumed to be the best, which has quite wrong consequences.
This commit is contained in:
TheEpicBlock
2025-11-02 00:57:34 +01:00
committed by GitHub
parent 52af16871a
commit d12b2f35c0

View File

@@ -260,7 +260,7 @@ func compareLoaderLists(a []string, b []string) int32 {
continue continue
} }
idx := slices.Index(loaderPreferenceList, v) idx := slices.Index(loaderPreferenceList, v)
if idx < minIdxA { if idx != -1 && idx < minIdxA {
return 1 // B has more preferable loaders return 1 // B has more preferable loaders
} }
if idx != -1 && idx < minIdxB { if idx != -1 && idx < minIdxB {