diff options
author | dada513 <dada513@protonmail.com> | 2022-03-27 14:51:02 +0200 |
---|---|---|
committer | dada513 <dada513@protonmail.com> | 2022-03-27 14:51:02 +0200 |
commit | 6a25cacc3e1609c7d3a1a75824c6ed2ab1a4faac (patch) | |
tree | 93b932140152cdb6c2482a135b024f0610c8dc19 /launcher/modplatform | |
parent | b1af689546704d5e05ef4bc44f43ce9e8bb4854c (diff) | |
parent | 81b50c0387c86de3acb1bf5a96b0045bf5f0aca7 (diff) | |
download | PrismLauncher-6a25cacc3e1609c7d3a1a75824c6ed2ab1a4faac.tar.gz PrismLauncher-6a25cacc3e1609c7d3a1a75824c6ed2ab1a4faac.tar.bz2 PrismLauncher-6a25cacc3e1609c7d3a1a75824c6ed2ab1a4faac.zip |
Merge branch 'develop' of https://github.com/PolyMC/PolyMC into develop
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index 9581ca04..992d6657 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -55,7 +55,8 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray // Find correct file (needed in cases where one version may have multiple files) // Will default to the last one if there's no primary (though I think Modrinth requires that // at least one file is primary, idk) - while (i < files.count()){ + // NOTE: files.count() is 1-indexed, so we need to subtract 1 to become 0-indexed + while (i < files.count() - 1){ auto parent = files[i].toObject(); auto fileName = Json::requireString(parent, "filename"); @@ -77,6 +78,7 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray i++; } + auto parent = files[i].toObject(); if(parent.contains("url")) { file.downloadUrl = Json::requireString(parent, "url"); |