From: Rudolf Polzer Date: Thu, 3 Jan 2013 20:11:21 +0000 (+0100) Subject: fix menuqc and csqc regarding !STRING X-Git-Tag: xonotic-v0.7.0~138 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=494e74528bf6a41bbcdc07bb1529f471be7393e1;p=xonotic%2Fxonotic-data.pk3dir.git fix menuqc and csqc regarding !STRING --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 066f32ef6..d6fd09e6d 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1240,7 +1240,7 @@ string getcommandkey(string text, string command) return text; keys = db_get(binddb, command); - if (!keys) + if (keys == "") { n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings for(j = 0; j < n; ++j) @@ -1258,10 +1258,12 @@ string getcommandkey(string text, string command) } } + if (keys == "") + keys = "NO_KEY"; db_put(binddb, command, keys); } - if ("" == keys) { + if (keys == "NO_KEY") { if (autocvar_hud_showbinds > 1) return sprintf(_("%s (not bound)"), text); else diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 35a0a0448..cc870794b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3112,13 +3112,13 @@ void HUD_RaceTimer (void) if(race_mycheckpointtime) { a = bound(0, 2 - (time - race_mycheckpointtime), 1); - s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy); + s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -(race_mycheckpointenemy == ""), race_mycheckpointlapsdelta, race_mycheckpointenemy); drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } if(race_othercheckpointtime && race_othercheckpointenemy != "") { a = bound(0, 2 - (time - race_othercheckpointtime), 1); - s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy); + s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -(race_othercheckpointenemy == ""), race_othercheckpointlapsdelta, race_othercheckpointenemy); drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 07998d09c..fe176e316 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -40,8 +40,9 @@ void Curl_URI_Get_Callback(float id, float status, string data) cvar_set(do_cvar, data); strunzone(do_cvar); } - if(!do_exec && !do_cvar) - print(data); + if(!do_exec) + if not(do_cvar) + print(data); } diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 869afbb57..4d9ce517d 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1476,8 +1476,12 @@ float isGametypeInFilter(float gt, float tp, float ts, string pattern) if(strstrofs(strcat(",", pattern, ","), subpattern, 0) < 0) if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) < 0) if(strstrofs(strcat(",", pattern, ","), subpattern3, 0) < 0) - if((!subpattern4) || strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0) - return 0; + { + if not(subpattern4) + return 0; + if(strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0) + return 0; + } } return 1; }