From 882e4a1243c6a8ec06a0391fe54aada55c298b10 Mon Sep 17 00:00:00 2001 From: Jakob MG Date: Sun, 25 Jan 2015 21:42:16 +0100 Subject: [PATCH] Bring back temp config support with LoadConfig --- qcsrc/server/miscfunctions.qc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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; -- 2.39.2