X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Futil.qc;h=4d704606d31275d4281b03e2fdb1f66c864bd6d4;hb=c21d7bb9d4f0b5f0cf78152f4baffc4b41e4bfb5;hp=3ef0213966933ea073240aac8d4f75a5786a5b3a;hpb=70b84d37e2cf1d5336c327cb43593024de2a2c6c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 3ef021396..4d704606d 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -1,14 +1,17 @@ #include "util.qh" + +#include "../item.qh" + #include "../menu.qh" -#include "../../common/campaign_common.qh" -#include "../../common/constants.qh" -#include "../../common/mapinfo.qh" -#include "../../common/util.qh" -#include "../../common/command/generic.qh" +#include +#include +#include +#include +#include float GL_CheckExtension(string ext) { - return (strstrofs(strcat(" ", cvar_string("gl_info_extensions"), " "), strcat(" ", ext, " "), 0) >= 0); + return strhasword(cvar_string("gl_info_extensions"), ext); } float GL_Have_TextureCompression() @@ -60,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); @@ -68,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) @@ -274,6 +284,7 @@ string _Nex_ExtResponseSystem_UpdateToURL; string _Nex_ExtResponseSystem_Packs; float _Nex_ExtResponseSystem_PacksStep; +/** engine callback */ void URI_Get_Callback(float id, float status, string data) { if(url_URI_Get_Callback(id, status, data))