33 setorigin(
this, this.
origin);
54 WriteVector(channel, o);
73bool autocvar_debugdraw;
77 string autocvar_debugdraw_filter, autocvar_debugdraw_filterout;
82 if (!autocvar_debugdraw)
return;
83 static int debugdraw_frame;
87 if (it.debugdraw_last == debugdraw_frame)
continue;
90 it.debugdraw_last = debugdraw_frame;
91 vector rgb = (it.debug) ?
'0 0 1' :
'1 0 0';
92 if (autocvar_debugdraw_filterout !=
"" && strhasword(autocvar_debugdraw_filterout, it.classname)) continue;
93 if (autocvar_debugdraw_filter !=
"" && !strhasword(autocvar_debugdraw_filter, it.classname)) continue;
94 if (autocvar_debugdraw == 3)
96 if (!it.entnum) continue;
98 if (autocvar_debugdraw == 4)
100 if (it.origin)
continue;
102 if (autocvar_debugdraw == 5)
104 if (!it.debug)
continue;
106 else if (autocvar_debugdraw > 5)
148 if (autocvar_debugdraw < 2)
continue;
153 o += it.tag_entity.origin;
155 if (pos.z < 0)
continue;
158 drawcolorcodedstring2_builtin(pos,
159 sprintf(
"%d: '%s'@%s", (it.debug ? it.sv_entnum :
etof(it)),
160 it.classname, it.sourceLoc),
175 if (!autocvar_debugdraw)
return;
180 if (autocvar_debugdraw < 2 &&
is_pure(e))
continue;
185 LOG_INFOF(
"%d server entities sent", n - rem);
209 LOG_INFO(bufstr_get(bufhandle, string_index));
243void(
float bufhandle,
string pattern,
string antipattern) buf_cvarlist = #517;
254 buf_cvarlist(h,
"",
"_");
255 int n = buf_getsize(h);
256 for (
int i = 0; i < n; ++i) {
257 string k = bufstr_get(h, i);
262 s =
strcat(s, k,
" \"", v,
"\" // \"", d,
"\"\n");
282bool autocvar_debugtrace;
286.bool debug_trace_button;
293 if (btn == it.debug_trace_button) skip =
true;
294 it.debug_trace_button = btn;
295 if (!btn || skip)
continue;
297 it.solid_prev = it.solid;
302 vector pos = it.origin + it.view_ofs;
305 it.solid = it.solid_prev;
310 STAT(TRACE_ENT, it) = i;
312 setorigin(e, e.origin +
'0 0 100');
313 stuffcmd(it, sprintf(
"prvm_edict server %d\n", i));
320void Trace_draw2d(
entity this)
322 int e =
STAT(TRACE_ENT);
332 e.draw2d = Trace_draw2d;
362 LOG_HELP(
" Where <classname> is the classname to search for.");
382 if (!
vdist(it.origin -
org, <, dist))
385 else if (it.origin !=
org)
400 LOG_HELP(
" Where <position> is a vector \"x y z\"");
429 this.hit_time =
time;
430 this.fade_rate = fade_rate_;
440 float since_created =
time - this.hit_time;
441 float alpha_ = 1 - since_created * this.
fade_rate;
450 if (screen_pos.z < 0)
return;
458 for(
int k = 0; k < n; ++k)
461 msg_pos = screen_pos + k * 1.25 *
size *
eY;
486#define debug_text_3d(...) EVAL(OVERLOAD(debug_text_3d, __VA_ARGS__))
487#define debug_text_3d_2(pos, msg) debug_text_3d_3(pos, msg, cvar("debug_text_3d_default_align"))
488#define debug_text_3d_3(pos, msg, align) debug_text_3d_4(pos, msg, align, cvar("debug_text_3d_default_duration"))
489#define debug_text_3d_4(pos, msg, align, dur) debug_text_3d_5(pos, msg, align, dur, stov(cvar_string("debug_text_3d_default_velocity")))
490#define debug_text_3d_5(pos, msg, align, dur, vel) debug_text_3d_fn(pos, msg, align, dur, vel)
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Header file that describes the resource system.
ATTRIB(DebugText3d, origin, vector)
DebugText3d(vector pos, string msg, float align, float fade_rate_, vector vel)
void DebugText3d_draw2d(DebugText3d this)
#define drawstring(position, text, scale, rgb, alpha, flag)
IntrusiveList g_drawables_2d
const int CMD_REQUEST_COMMAND
const int CMD_REQUEST_USAGE
#define GENERIC_COMMAND(id, description, menubased)
bool debug_send(entity this, entity to, int sf)
ERASEABLE void debug_text_3d_fn(vector pos, string msg, float align, float duration, vector vel)
#define debug_text_3d(...)
#define PHYS_INPUT_BUTTON_HOOK(s)
const float DRAWFLAG_NORMAL
#define MAKE_VECTORS(angles, forward, right, up)
Same as the makevectors builtin but uses the provided locals instead of the v_* globals.
#define tokenizebyseparator
#define GetProgramCommandPrefix()
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define FOREACH_ENTITY_ORDERED(cond, body)
#define FOREACH_ENTITY_CLASS_ORDERED(class, cond, body)
#define FOREACH_ENTITY_RADIUS(org, dist, cond, body)
#define FOREACH_ENTITY(cond, body)
noref float vid_conheight
#define NET_HANDLE(id, param)
#define Net_Accept(classname)
#define WriteHeader(to, id)
#define REGISTER_NET_TEMP(id)
#define REGISTER_STAT(...)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define make_pure(e)
direct use is
#define DESTRUCTOR(cname)
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define CONSTRUCTOR(cname,...)
string sourceLoc
Location entity was spawned from in source.
#define CONSTRUCT(cname,...)
float health
Legacy fields for the resources. To be removed.
#define COMMON_COMMAND(id, description)
#define STATIC_INIT(func)
during worldspawn
if(frag_attacker.flagcarried)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
vector project_3d_to_2d(vector vec)