- if (dist > 0)
- FOREACH_ENTITY_ORDERED(vdist(it.origin - org, <, dist), LOG_HELPF("%i (%s)", it, it.classname));
- else
- FOREACH_ENTITY_ORDERED(it.origin == org, LOG_HELPF("%i (%s)", it, it.classname));
+ int entcnt = 0;
+ FOREACH_ENTITY_ORDERED(true,
+ {
+ if (dist > 0)
+ {
+ if (!vdist(it.origin - org, <, dist))
+ continue;
+ }
+ else if (it.origin != org)
+ continue;
+ LOG_HELPF("%i (%s)", it, it.classname);
+ ++entcnt;
+ });
+ if(entcnt)
+ LOG_HELPF("Found %d entities", entcnt);