From a4c4277509e0ac96c37f7a0d2198a6f82a8b62fa Mon Sep 17 00:00:00 2001 From: Jan Naahs Date: Sun, 27 Dec 2020 11:21:23 +0100 Subject: [PATCH] fix compatibility check for mod releases --- src/factorio/mod_modInfo.go | 2 +- src/factorio/mod_portal.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/factorio/mod_modInfo.go b/src/factorio/mod_modInfo.go index 74382f2..42be1f8 100644 --- a/src/factorio/mod_modInfo.go +++ b/src/factorio/mod_modInfo.go @@ -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" { diff --git a/src/factorio/mod_portal.go b/src/factorio/mod_portal.go index 678b2d1..385dc3a 100644 --- a/src/factorio/mod_portal.go +++ b/src/factorio/mod_portal.go @@ -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 }