X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=f45aeef7ed88d83dea4d578a366bc8078e256e43;hb=30648cd6167b20ad5924c03cd39efff9ef5b62df;hp=6d580bd2d69a8b65631a465d0adee730e6bca07d;hpb=34e7f534e2015466228eb3a78c9857741b736dca;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 6d580bd2d..f45aeef7e 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -257,6 +257,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars") } } +#ifdef DEBUGTRACE REGISTER_STAT(TRACE_ENT, int) #ifdef SVQC bool autocvar_debugtrace; @@ -280,7 +281,7 @@ MUTATOR_HOOKFUNCTION(trace, SV_StartFrame) vector forward = '0 0 0'; vector right = '0 0 0'; vector up = '0 0 0'; MAKEVECTORS(makevectors, it.v_angle, forward, right, up); vector pos = it.origin + it.view_ofs; - traceline(pos, pos + forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, it); + traceline(pos, pos + forward * max_shot_distance, MOVE_NORMAL, it); FOREACH_ENTITY(true, { it.solid = it.solid_prev; it.solid_prev = 0; @@ -312,6 +313,7 @@ STATIC_INIT(TRACE_ENT) IL_PUSH(g_drawables_2d, e); } #endif +#endif GENERIC_COMMAND(find, "Search through entities for matching classname") { @@ -319,7 +321,14 @@ GENERIC_COMMAND(find, "Search through entities for matching classname") { case CMD_REQUEST_COMMAND: { - FOREACH_ENTITY_CLASS_ORDERED(argv(1), true, LOG_INFOF("%i (%s)\n", it, it.classname)); + int entcnt = 0; + FOREACH_ENTITY_CLASS_ORDERED(argv(1), true, + { + LOG_INFOF("%i (%s)\n", it, it.classname); + ++entcnt; + }); + if(entcnt) + LOG_INFOF("Found %d entities\n", entcnt); return; }