mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Fix CurseForge file loader/ID comparison
(unsigned arithmetic moment)
This commit is contained in:
parent
7de26ec5c3
commit
21876cba1e
@ -306,11 +306,11 @@ func findLatestFile(modInfoData modInfo, mcVersions []string, packLoaders []stri
|
|||||||
compare := int32(mcVerIdx - bestMcVer)
|
compare := int32(mcVerIdx - bestMcVer)
|
||||||
if compare == 0 {
|
if compare == 0 {
|
||||||
// Prefer higher loader indexes
|
// Prefer higher loader indexes
|
||||||
compare = int32(loaderIdx - bestLoaderType)
|
compare = int32(loaderIdx) - int32(bestLoaderType)
|
||||||
}
|
}
|
||||||
if compare == 0 {
|
if compare == 0 {
|
||||||
// Other comparisons are equal, compare by ID instead
|
// Other comparisons are equal, compare by ID instead
|
||||||
compare = int32(v.ID - fileID)
|
compare = int32(int64(v.ID) - int64(fileID))
|
||||||
}
|
}
|
||||||
if compare > 0 {
|
if compare > 0 {
|
||||||
fileID = v.ID
|
fileID = v.ID
|
||||||
@ -333,11 +333,11 @@ func findLatestFile(modInfoData modInfo, mcVersions []string, packLoaders []stri
|
|||||||
compare := int32(mcVerIdx - bestMcVer)
|
compare := int32(mcVerIdx - bestMcVer)
|
||||||
if compare == 0 {
|
if compare == 0 {
|
||||||
// Prefer higher loader indexes
|
// Prefer higher loader indexes
|
||||||
compare = int32(loaderIdx - bestLoaderType)
|
compare = int32(loaderIdx) - int32(bestLoaderType)
|
||||||
}
|
}
|
||||||
if compare == 0 {
|
if compare == 0 {
|
||||||
// Other comparisons are equal, compare by ID instead
|
// Other comparisons are equal, compare by ID instead
|
||||||
compare = int32(v.ID - fileID)
|
compare = int32(int64(v.ID) - int64(fileID))
|
||||||
}
|
}
|
||||||
if compare > 0 {
|
if compare > 0 {
|
||||||
fileID = v.ID
|
fileID = v.ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user