aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-25 09:05:04 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-25 09:05:04 +0300
commitc54fecf5d9dd21dbc2b55f9a7d721f61fde034b3 (patch)
tree28d129e60e6fa3affcb278389510b5e398fd67e8 /launcher/modplatform
parent172680abf89e3d6312f48f0e1a6949ed4fc260be (diff)
downloadPrismLauncher-c54fecf5d9dd21dbc2b55f9a7d721f61fde034b3.tar.gz
PrismLauncher-c54fecf5d9dd21dbc2b55f9a7d721f61fde034b3.tar.bz2
PrismLauncher-c54fecf5d9dd21dbc2b55f9a7d721f61fde034b3.zip
added condition for empty loader type
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r--launcher/modplatform/flame/FlameAPI.cpp2
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp4
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/launcher/modplatform/flame/FlameAPI.cpp b/launcher/modplatform/flame/FlameAPI.cpp
index 8d01f779..e99ce3a5 100644
--- a/launcher/modplatform/flame/FlameAPI.cpp
+++ b/launcher/modplatform/flame/FlameAPI.cpp
@@ -133,7 +133,7 @@ auto FlameAPI::getLatestVersion(VersionSearchArgs&& args) -> ModPlatform::Indexe
for (auto file : arr) {
auto file_obj = Json::requireObject(file);
auto file_tmp = FlameMod::loadIndexedPackVersion(file_obj);
- if (file_tmp.date > ver.date && (!args.loaders.has_value() || args.loaders.value() & file_tmp.loaders))
+ if (file_tmp.date > ver.date && (!args.loaders.has_value() || !file_tmp.loaders || args.loaders.value() & file_tmp.loaders))
ver = file_tmp;
}
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp
index 67e3468f..a63bdc99 100644
--- a/launcher/modplatform/flame/FlameModIndex.cpp
+++ b/launcher/modplatform/flame/FlameModIndex.cpp
@@ -91,7 +91,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
file.addonId = pack.addonId;
if (file.fileId.isValid() &&
- (!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
+ (!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
unsortedVersions.append(file);
}
@@ -202,7 +202,7 @@ ModPlatform::IndexedVersion FlameMod::loadDependencyVersions(const ModPlatform::
file.addonId = m.addonId;
if (file.fileId.isValid() &&
- (!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
+ (!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
versions.append(file);
}
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
index d857e82a..107b9900 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
@@ -105,7 +105,7 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra
auto file = loadIndexedPackVersion(obj);
if (file.fileId.isValid() &&
- (!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
+ (!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
unsortedVersions.append(file);
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
@@ -242,7 +242,7 @@ auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Depend
auto file = loadIndexedPackVersion(obj);
if (file.fileId.isValid() &&
- (!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
+ (!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
versions.append(file);
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {