X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=6d580bd2d69a8b65631a465d0adee730e6bca07d;hb=34e7f534e2015466228eb3a78c9857741b736dca;hp=9aca8e774c34a669cf3439f6656914c703b7a0a3;hpb=8ba1f6c672361186033b8bebc3be677ac94bd4da;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 9aca8e774..6d580bd2d 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -4,7 +4,7 @@ .entity tag_entity; #endif -#ifndef MENUQC +#ifdef GAMEQC .bool debug; .int sv_entnum; REGISTER_NET_TEMP(net_debug) @@ -47,7 +47,7 @@ REGISTER_NET_TEMP(net_debug) } #endif -#ifndef MENUQC +#ifdef GAMEQC /** * 0: off * 1: on @@ -100,7 +100,7 @@ bool autocvar_debugdraw; // if (it.entnum) break; // if (it.drawmask) break; // if (it.predraw) break; -// if (it.movetype) break; +// if (it.move_movetype) break; if (it.solid) break; // if (it.origin) break; // if (it.oldorigin) break; @@ -223,6 +223,40 @@ GENERIC_COMMAND(version, "Print the current version") } } +#ifdef CSQC +void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517; +#endif +GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars") +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + string s = ""; + int h = buf_create(); + buf_cvarlist(h, "", "_"); // exclude all _ cvars as they are temporary + int n = buf_getsize(h); + for (int i = 0; i < n; ++i) { + string k = bufstr_get(h, i); + string v = cvar_string(k); + string d = cvar_defstring(k); + if (v == d) + continue; + s = strcat(s, k, " \"", v, "\" // \"", d, "\"\n"); + } + buf_del(h); + LOG_INFO(s); + return; + } + default: + case CMD_REQUEST_USAGE: + { + LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges")); + return; + } + } +} + REGISTER_STAT(TRACE_ENT, int) #ifdef SVQC bool autocvar_debugtrace; @@ -275,6 +309,7 @@ STATIC_INIT(TRACE_ENT) { entity e = TRACE_ENT = new_pure(TRACE_ENT); e.draw2d = Trace_draw2d; + IL_PUSH(g_drawables_2d, e); } #endif