You've already forked factorio-server-manager
mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2026-06-19 20:06:55 +02:00
bugfix: wrongly shown compatibility
This commit is contained in:
+6
-1
@@ -88,7 +88,12 @@ func (modInfoList *ModInfoList) listInstalledMods() error {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
modInfo.Compatibility = true
|
||||
log.Println("error finding basemodDependency. Using FactorioVersion...")
|
||||
modInfo.Compatibility, err = checkModCompatibility(modInfo.FactorioVersion + ".0")
|
||||
if err != nil {
|
||||
log.Printf("error checking Compatibility with FactorioVersion: %s", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
modInfoList.Mods = append(modInfoList.Mods, modInfo)
|
||||
|
||||
+3
-2
@@ -348,8 +348,9 @@ func modStartUp() {
|
||||
|
||||
func checkModCompatibility(modVersion string) (compatible bool, err error) {
|
||||
compatible = false
|
||||
if !strings.HasPrefix(modVersion, "^") {
|
||||
modVersion = "^" + modVersion
|
||||
modVersion = strings.TrimSpace(modVersion)
|
||||
if !strings.HasPrefix(modVersion, "~") {
|
||||
modVersion = "~" + modVersion
|
||||
}
|
||||
|
||||
constraint, err := semver.NewConstraint(modVersion)
|
||||
|
||||
Reference in New Issue
Block a user