Do not inform of mod update if remote version is older than local

This commit is contained in:
Ivan Savenko committed 2024-11-26 21:05:18 +00:00
1 parent 8a0d327ac2
commit a80f65439b
3 files changed
+16 -1

No files matched your search

+14
View File
@@ -216,4 +216,18 @@ bool ModDescription::affectsGameplay() const
return false;
}
bool ModDescription::isUpdateAvailable() const
{
if (getRepositoryValue("version").isNull())
return false;
if (getLocalValue("version").isNull())
return false;
auto localVersion = CModVersion::fromString(getLocalValue("version").String());
auto repositoryVersion = CModVersion::fromString(getRepositoryValue("version").String());
return localVersion < repositoryVersion;
}
VCMI_LIB_NAMESPACE_END