diff options
author | Ezekiel Smith <ezekielsmith@protonmail.com> | 2022-03-24 20:28:12 +1100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-03-24 11:10:11 +0100 |
commit | eb06d0116f68307cd33f3a9391bdbd0f22559799 (patch) | |
tree | a644d62b4c0bc06286f5840eabc79f286c5f2b28 /launcher | |
parent | 6025cd0ca5d55f58bf1079bfe87c77d7afdc34e0 (diff) | |
download | PrismLauncher-eb06d0116f68307cd33f3a9391bdbd0f22559799.tar.gz PrismLauncher-eb06d0116f68307cd33f3a9391bdbd0f22559799.tar.bz2 PrismLauncher-eb06d0116f68307cd33f3a9391bdbd0f22559799.zip |
Merge pull request #334 from flowln/right_file_2
Fix skipping file in mod version parsing
Diffstat (limited to 'launcher')
-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"); |