queue_start.FindConnectedComponent_processing = 0;
}
+float Count_Proper_Strings(string improper, string...count)
+{
+ float i, total = 0;
+ string tmp;
+
+ for(i = 0; i < count; ++i)
+ {
+ tmp = ...(i, string);
+ if((tmp) && (tmp != improper)) { ++total; }
+ }
+
+ return total;
+}
+
+float Count_Proper_Floats(float improper, float...count)
+{
+ float i, total = 0;
+
+ for(i = 0; i < count; ++i)
+ {
+ if(...(i, float) != improper) { ++total; }
+ }
+
+ return total;
+}
+
+// todo: this sucks, lets find a better way to do backtraces?
+#ifndef MENUQC
+void backtrace(string msg)
+{
+ float dev, war;
+ #ifdef SVQC
+ dev = autocvar_developer;
+ war = autocvar_prvm_backtraceforwarnings;
+ #else
+ dev = cvar("developer");
+ war = cvar("prvm_backtraceforwarnings");
+ #endif
+ cvar_set("developer", "1");
+ cvar_set("prvm_backtraceforwarnings", "1");
+ print("\n");
+ print("--- CUT HERE ---\nWARNING: ");
+ print(msg);
+ print("\n");
+ remove(world); // isn't there any better way to cause a backtrace?
+ print("\n--- CUT UNTIL HERE ---\n");
+ cvar_set("developer", ftos(dev));
+ cvar_set("prvm_backtraceforwarnings", ftos(war));
+}
+#endif
+
+// color code replace, place inside of sprintf and parse the string
+string CCR(string input)
+{
+ // See the autocvar declarations in util.qh for default values
+
+ // foreground/normal colors
+ input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input);
+ input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input);
+ input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input);
+ input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input);
+
+ // "kill" colors
+ input = strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), input);
+ input = strreplace("^K2", strcat("^", autocvar_hud_colorset_kill_2), input);
+ input = strreplace("^K3", strcat("^", autocvar_hud_colorset_kill_3), input);
+
+ // background colors
+ input = strreplace("^BG", strcat("^", autocvar_hud_colorset_background), input);
+ input = strreplace("^N", "^7", input); // "none"-- reset to white...
+ return input;
+}
++
+ vector vec3(float x, float y, float z)
+ {
+ vector v;
+ v_x = x;
+ v_y = y;
+ v_z = z;
+ return v;
+ }
+
+ #ifndef MENUQC
+ vector animfixfps(entity e, vector a, vector b)
+ {
+ // multi-frame anim: keep as-is
+ if(a_y == 1)
+ {
+ float dur;
+ dur = frameduration(e.modelindex, a_x);
+ if(dur <= 0 && b_y)
+ {
+ a = b;
+ dur = frameduration(e.modelindex, a_x);
+ }
+ if(dur > 0)
+ a_z = 1.0 / dur;
+ }
+ return a;
+ }
+ #endif
typedef float(entity a, entity b, entity pass) isConnectedFunction_t;
void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass);
+// expand multiple arguments into one argument by stripping parenthesis
+#define XPD(...) __VA_ARGS__
+
+float Count_Proper_Strings(string improper, string...count);
+float Count_Proper_Floats(float improper, float...count);
+
+#ifndef MENUQC
+void backtrace(string msg);
+#endif
+
+// color code replace, place inside of sprintf and parse the string... defaults described as constants
+// foreground/normal colors
+var string autocvar_hud_colorset_foreground_1 = "2"; // F1 - Green // primary priority (important names, etc)
+var string autocvar_hud_colorset_foreground_2 = "3"; // F2 - Yellow // secondary priority (items, locations, numbers, etc)
+var string autocvar_hud_colorset_foreground_3 = "4"; // F3 - Blue // tertiary priority or relatively inconsequential text
+var string autocvar_hud_colorset_foreground_4 = "1"; // F4 - Red // notice/attention grabbing texting
+// "kill" colors
+var string autocvar_hud_colorset_kill_1 = "1"; // K1 - Red // "bad" or "dangerous" text (death messages against you, kill notifications, etc)
+var string autocvar_hud_colorset_kill_2 = "3"; // K2 - Yellow // similar to above, but less important... OR, a highlight out of above message type
+var string autocvar_hud_colorset_kill_3 = "4"; // K3 - Blue // "good" or "beneficial" text (you fragging someone, etc)
+// background color
+var string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimportant text
+
+string CCR(string input);
+
+#ifndef MENUQC
+#ifdef CSQC
+#define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
+#else
+#define GENTLE autocvar_sv_gentle
+#endif
+#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
+#endif
+
+// allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
+#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
+#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
+#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
++
+ vector vec3(float x, float y, float z);
+
+ #ifndef MENUQC
+ vector animfixfps(entity e, vector a, vector b);
+ #endif
case VOICETYPE_TAUNT:
if(self.classname == "player")
if(self.deadflag == DEAD_NO)
- setanim(self, self.anim_taunt, FALSE, TRUE, TRUE);
+ animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
msg_entity = self;
if (msg_entity.cvar_cl_voice_directional >= 1)
case VOICETYPE_TAUNT:
if(self.classname == "player")
if(self.deadflag == DEAD_NO)
- setanim(self, self.anim_taunt, FALSE, TRUE, TRUE);
+ animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
FOR_EACH_REALCLIENT(msg_entity)
{
../warpzonelib/util_server.qc
../warpzonelib/server.qc
+ ../common/animdecide.qc
../common/util.qc
+../common/notifications.qc
../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail