]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bring back temp config support with LoadConfig
authorJakob MG <tzork@xonotic.org>
Sun, 25 Jan 2015 20:42:16 +0000 (21:42 +0100)
committerJakob MG <tzork@xonotic.org>
Sun, 25 Jan 2015 20:42:16 +0000 (21:42 +0100)
qcsrc/server/miscfunctions.qc

index 4f20597348b4a2c5e1ac7d67e131a5e8f6bc8868..9b53accc416b49ef44e92205af3eabba32531c8a 100644 (file)
@@ -2376,7 +2376,7 @@ float isPushable(entity e)
 
 float LoadConfig(string FileName, int AsTemp)
 {
-               string s;
+               string s, c_var, c_val;
                float fh = fopen(FileName, FILE_READ);
                if(fh >= 0)
                {
@@ -2384,10 +2384,23 @@ float LoadConfig(string FileName, int AsTemp)
                        {
                                tokenize_console(s);
                                if not(argv(0) == "" || argv(1) == "//" || argv(1) == "")
+                               {
+                    if(argv(0) == "set" || argv(0) == "seta")
+                    {
+                        c_var = argv(1);
+                        c_val = argv(2);
+                    }
+                    else
+                    {
+                        c_var = argv(0);
+                        c_val = argv(1);
+                    }
+
                                        if(AsTemp)
-                        cvar_settemp(argv(0), argv(1));
+                        cvar_settemp(c_var, c_val);
                     else
-                        cvar_set(argv(0), argv(1));
+                        cvar_set(c_var, c_val);
+                }
                        }
                        fclose(fh);
             return 0;