]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Show the number of entities found with find command
authorMario <mario@smbclan.net>
Sun, 26 Feb 2017 12:47:40 +0000 (22:47 +1000)
committerMario <mario@smbclan.net>
Sun, 26 Feb 2017 12:47:40 +0000 (22:47 +1000)
qcsrc/common/debug.qh

index 10a69a70685ebdfdc79c481295410179215fe40d..8bdbcf705eefc45f0e302aac5e6bba4387026414 100644 (file)
@@ -319,7 +319,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 %i entities\n", entcnt);
                        return;
                }