]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/debug.qh
Merge branch 'martin-t/units' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / debug.qh
index 10a69a70685ebdfdc79c481295410179215fe40d..28153a7d404a0eb764de7ca093c79ab43c04cd2f 100644 (file)
@@ -47,6 +47,7 @@ REGISTER_NET_TEMP(net_debug)
        }
 #endif
 
+#if ENABLE_DEBUGDRAW
 #ifdef GAMEQC
 /**
  * 0: off
@@ -182,6 +183,7 @@ bool autocvar_debugdraw;
                }
        }
 #endif
+#endif
 
 GENERIC_COMMAND(bufstr_get, "Examine a string buffer object")
 {
@@ -257,6 +259,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars")
        }
 }
 
+#if ENABLE_DEBUGTRACE
 REGISTER_STAT(TRACE_ENT, int)
 #ifdef SVQC
 bool autocvar_debugtrace;
@@ -312,6 +315,7 @@ STATIC_INIT(TRACE_ENT)
        IL_PUSH(g_drawables_2d, e);
 }
 #endif
+#endif
 
 GENERIC_COMMAND(find, "Search through entities for matching classname")
 {
@@ -319,7 +323,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;
                }