]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/debug.qh
entcs: use REGISTER_NET_TEMP, not REGISTER_NET_LINKED
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / debug.qh
index 7301489f32093d0c34232bb32fc0b30a6adb4cb8..25dc11d1c391f2e2e1907cb0a868dd47f1169371 100644 (file)
@@ -43,6 +43,7 @@ REGISTER_NET_TEMP(net_debug)
 bool autocvar_debugdraw;
 
 #ifdef CSQC
+       string autocvar_debugdraw_filter;
        .int debugdraw_last;
        vector project_3d_to_2d(vector vec);
        void Debug_Draw()
@@ -51,15 +52,15 @@ bool autocvar_debugdraw;
                static int debugdraw_frame;
                ++debugdraw_frame;
                const int size = 8;
-               for (entity e1 = NULL; (e1 = nextent(e1)); )
-               {
-                       if (e1.debugdraw_last == debugdraw_frame) continue;
+               FOREACH_ENTITY(true, LAMBDA(
+                       if (it.debugdraw_last == debugdraw_frame) continue;
                        int ofs = 0;
-                       for (entity e = findradius(e1.origin, 100); e; e = e.chain)
+                       for (entity e = findradius(it.origin, 100); e; e = e.chain)
                        {
                                if (e.debugdraw_last == debugdraw_frame) continue;
                                e.debugdraw_last = debugdraw_frame;
                                vector rgb = (e.debug) ? '0 0 1' : '1 0 0';
+                               if (autocvar_debugdraw_filter != "" && !strhasword(autocvar_debugdraw_filter, e.classname)) continue;
                                if (is_pure(e))
                                {
                                        if (autocvar_debugdraw < 2) continue;
@@ -75,7 +76,7 @@ bool autocvar_debugdraw;
                                        size * '1 1 0', rgb, 0.5, DRAWFLAG_NORMAL);
                                ++ofs;
                        }
-               }
+               ));
        }
 #endif