mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-18 17:14:32 +01:00
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:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user