You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix mod version compatibility checking for major version differences (#575)
This fixes issue #517 where the auto mod updater was downloading the wrong
mod versions after updating to Space Age (Factorio 2.0). The problem was that
the version checking logic was incorrectly rejecting compatible mod versions.
Changes:
- Fixed check_game_version() to properly handle major version differences
- Game versions can now run mods designed for older major versions (backward compatibility)
- Game versions correctly reject mods requiring newer versions
- Fixed variable references in check_dependency_version()
- Added clarifying comments about the version checking behavior
This also addresses issue #468 by ensuring mods requiring newer Factorio
versions than currently installed are properly skipped.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <[email protected]>
# If game major version is greater than mod's required major version, it's compatible
39
+
if [[ "$game_major"-gt"$mod_major" ]];then
40
+
echo 1
41
+
return
42
+
fi
37
43
38
-
if [[ "$game_major"-ne"$mod_major" ]];then
44
+
# If game major version is less than mod's required major version, it's not compatible
45
+
if [[ "$game_major"-lt"$mod_major" ]];then
39
46
echo 0
40
47
return
41
48
fi
42
49
43
-
if [[ "$mod_minor"-ge"$game_minor" ]];then
50
+
# Major versions are equal, check minor versions
51
+
# Game minor version must be >= mod's required minor version
52
+
if [[ "$game_minor"-ge"$mod_minor" ]];then
44
53
echo 1
45
54
else
46
55
echo 0
@@ -79,7 +88,7 @@ check_dependency_version()
79
88
fi
80
89
;;
81
90
">")
82
-
if [[ "$(printf '%s\n%s\n'"$required_version""$mod_version"| sort -V | head -n1)"=="$required_version"&&"$required_version"!="$FACTORIO_VERSION" ]];then
91
+
if [[ "$(printf '%s\n%s\n'"$required_version""$mod_version"| sort -V | head -n1)"=="$required_version"&&"$required_version"!="$mod_version" ]];then
83
92
echo 1
84
93
else
85
94
echo 0
@@ -93,7 +102,7 @@ check_dependency_version()
93
102
fi
94
103
;;
95
104
"<")
96
-
if [[ "$(printf '%s\n%s\n'"$required_version""$mod_version"| sort -V | tail -n1)"=="$required_version"&&"$required_version"!="$FACTORIO_VERSION" ]];then
105
+
if [[ "$(printf '%s\n%s\n'"$required_version""$mod_version"| sort -V | tail -n1)"=="$required_version"&&"$required_version"!="$mod_version" ]];then
97
106
echo 1
98
107
else
99
108
echo 0
@@ -116,11 +125,15 @@ get_mod_info()
116
125
{
117
126
local mod_info_json="$1"
118
127
128
+
# Process mod releases from newest to oldest, looking for a compatible version
0 commit comments