Skip to content

Commit bd8a595

Browse files
committed
bugfix: wrongly shown compatibility
1 parent 868b3a3 commit bd8a595

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/mod_modInfo.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ func (modInfoList *ModInfoList) listInstalledMods() error {
8888
return err
8989
}
9090
} else {
91-
modInfo.Compatibility = true
91+
log.Println("error finding basemodDependency. Using FactorioVersion...")
92+
modInfo.Compatibility, err = checkModCompatibility(modInfo.FactorioVersion + ".0")
93+
if err != nil {
94+
log.Printf("error checking Compatibility with FactorioVersion: %s", err)
95+
return err
96+
}
9297
}
9398

9499
modInfoList.Mods = append(modInfoList.Mods, modInfo)

src/mods.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ func modStartUp() {
348348

349349
func checkModCompatibility(modVersion string) (compatible bool, err error) {
350350
compatible = false
351-
if !strings.HasPrefix(modVersion, "^") {
352-
modVersion = "^" + modVersion
351+
modVersion = strings.TrimSpace(modVersion)
352+
if !strings.HasPrefix(modVersion, "~") {
353+
modVersion = "~" + modVersion
353354
}
354355

355356
constraint, err := semver.NewConstraint(modVersion)

0 commit comments

Comments
 (0)