Added back api loader filtering if just one is selected

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-08-26 22:26:01 +03:00
parent abfd1a4205
commit 288d0d1fd4
3 changed files with 19 additions and 7 deletions

View File

@ -135,11 +135,6 @@ void Flame::FileResolvingTask::netJobFinished()
m_checkJob->start();
}
constexpr bool has_single_bit(int x) noexcept
{
return x && !(x & (x - 1));
}
void Flame::FileResolvingTask::modrinthCheckFinished()
{
setProgress(2, 3);
@ -159,7 +154,7 @@ void Flame::FileResolvingTask::modrinthCheckFinished()
// If there's more than one mod loader for this version, we can't know for sure
// which file is relative to each loader, so it's best to not use any one and
// let the user download it manually.
if (!file.loaders || has_single_bit(file.loaders)) {
if (!file.loaders || hasSingleModLoaderSelected(file.loaders)) {
out->url = file.downloadUrl;
qDebug() << "Found alternative on modrinth " << out->fileName;
} else {