From: terencehill Date: Sun, 15 Nov 2015 18:44:17 +0000 (+0100) Subject: Fix saveCvarsMulti sending cvars prefixed with ! X-Git-Tag: xonotic-v0.8.2~1658^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=599c7b559f7ca8cde0b11b2206a88536bfaac027;p=xonotic%2Fxonotic-data.pk3dir.git Fix saveCvarsMulti sending cvars prefixed with ! --- diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 426048002..b879257b7 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -63,7 +63,7 @@ string getCvarsMulti(entity me) void saveCvarsMulti(entity me) { float n, i; - string s; + string s, cvarname; me.saveCvars_Multi(me); s = cvar_string(me.cvarName); @@ -71,12 +71,19 @@ void saveCvarsMulti(entity me) n = tokenize_console(me.cvarNames_Multi); for(i = 0; i < n; ++i) { + // cvars prefixed with ! get saved with the inverted value if(substring(argv(i), 0, 1) == "!") - cvar_set(substring(argv(i), 1, strlen(argv(i))), ((s == "0") ? "1" : "0")); + { + cvarname = substring(argv(i), 1, strlen(argv(i))); + cvar_set(cvarname, ((s == "0") ? "1" : "0")); + } else - cvar_set(argv(i), s); + { + cvarname = argv(i); + cvar_set(cvarname, s); + } - CheckSendCvars(me, argv(i)); + CheckSendCvars(me, cvarname); } } void makeMulti(entity e, string otherCvars)