Merge pull request #205 from OpenFactorioServerManager/fix/compatibility-check-for-mod-releases

fix compatibility check for mod releases
This commit is contained in:
knoxfighter 2020-12-27 14:26:20 +01:00 committed by GitHub
commit 1f6ebbb992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -86,7 +86,7 @@ func (modInfoList *ModInfoList) listInstalledMods() error {
// skip optional and incompatible dependencies
parts := strings.Split(dep, " ")
if len(parts) > 3 {
log.Printf("skipping dependency '%s' in '%s': invalid format\n", dep, modInfo.Name)
log.Printf("skipping dependency '%s' in '%s': optional dependency or invalid format\n", dep, modInfo.Name)
continue
}
if parts[0] != "base" {

View File

@ -96,9 +96,7 @@ func ModPortalModDetails(modId string) (ModPortalStruct, error, int) {
for key, release := range mod.Releases {
requiredVersion = release.InfoJSON.FactorioVersion
areVersionIdentical := requiredVersion.Equals(installedBaseVersion)
isException := installedBaseVersion.Equals(Version{1, 0, 0, 0}) && requiredVersion.Equals(Version{0, 18, 0, 0})
release.Compatibility = areVersionIdentical || isException
release.Compatibility = installedBaseVersion.GreaterC(requiredVersion)
mod.Releases[key] = release
}