diff options
author | flow <thiagodonato300@gmail.com> | 2022-03-22 19:37:10 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-03-22 19:45:31 -0300 |
commit | f3a244e90a528196ce8c0d2c13f747d9fb4dbcf9 (patch) | |
tree | a037ece09eb11771e015dd5e3f49e7ce32e436fa /launcher | |
parent | c7fdfb811669a863606dc0a26186c0ab827db9c6 (diff) | |
download | PrismLauncher-f3a244e90a528196ce8c0d2c13f747d9fb4dbcf9.tar.gz PrismLauncher-f3a244e90a528196ce8c0d2c13f747d9fb4dbcf9.tar.bz2 PrismLauncher-f3a244e90a528196ce8c0d2c13f747d9fb4dbcf9.zip |
fix: fix skipping one on file counting in mod version parse
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"); |