]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
special case pre-1.0 versions to be compatible with any gameversion below 1.0
authorRudolf Polzer <divverent@xonotic.org>
Sat, 4 Jun 2011 20:30:57 +0000 (22:30 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 4 Jun 2011 20:30:57 +0000 (22:30 +0200)
all

diff --git a/all b/all
index 8b3806e4201e4f2eea742b4737774d351006d18f..a99532076ae863f645e6e218b0d27b26848df8ef 100755 (executable)
--- a/all
+++ b/all
@@ -1847,11 +1847,21 @@ case "$cmd" in
                                        versionstr="$versionstr$RELEASETYPE"
                                        ;;
                        esac
-                       verbose sed "
-                               s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
-                               s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
-                               s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
-                       " < defaultXonotic.cfg > defaultXonotic.cfg.new
+                       if [ $gv -lt 900 ]; then
+                               # pre-1.0: compatible with any other pre-1.0
+                               verbose sed "
+                                       s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
+                                       s/^gameversion_min [0-9]*/gameversion_min     0/;
+                                       s/^gameversion_max [0-9]*/gameversion_max  9999/;
+                               " < defaultXonotic.cfg > defaultXonotic.cfg.new
+                       else
+                               # >= 1.0
+                               verbose sed "
+                                       s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
+                                       s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
+                                       s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
+                               " < defaultXonotic.cfg > defaultXonotic.cfg.new
+                       fi
                        mv defaultXonotic.cfg.new defaultXonotic.cfg
                        case "$RELEASETYPE" in
                                release)