From: Jakob MG Date: Sun, 25 Jan 2015 20:42:16 +0000 (+0100) Subject: Bring back temp config support with LoadConfig X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=882e4a1243c6a8ec06a0391fe54aada55c298b10;p=xonotic%2Fxonotic-data.pk3dir.git Bring back temp config support with LoadConfig --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 4f2059734..9b53accc4 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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;