mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-04 20:36:58 +03:00
fix:resource update with loaders
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
a75713897d
commit
bd570aa5d1
5 changed files with 63 additions and 23 deletions
|
|
@ -218,9 +218,19 @@ QList<ModPlatform::Category> FlameAPI::loadModCategories(std::shared_ptr<QByteAr
|
|||
|
||||
std::optional<ModPlatform::IndexedVersion> FlameAPI::getLatestVersion(QList<ModPlatform::IndexedVersion> versions,
|
||||
QList<ModPlatform::ModLoaderType> instanceLoaders,
|
||||
ModPlatform::ModLoaderTypes modLoaders)
|
||||
ModPlatform::ModLoaderTypes modLoaders,
|
||||
bool checkLoaders)
|
||||
{
|
||||
static const auto noLoader = ModPlatform::ModLoaderType(0);
|
||||
if (!checkLoaders) {
|
||||
std::optional<ModPlatform::IndexedVersion> ver;
|
||||
for (auto file_tmp : versions) {
|
||||
if (!ver.has_value() || file_tmp.date > ver->date) {
|
||||
ver = file_tmp;
|
||||
}
|
||||
}
|
||||
return ver;
|
||||
}
|
||||
QHash<ModPlatform::ModLoaderType, ModPlatform::IndexedVersion> bestMatch;
|
||||
auto checkVersion = [&bestMatch](const ModPlatform::IndexedVersion& version, const ModPlatform::ModLoaderType& loader) {
|
||||
if (bestMatch.contains(loader)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue