X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=ca0e28f04680e24b4585ebf41f88b0b9bed2d0b5;hb=54c73db251372d28956d780656c4a0a78a2e54ca;hp=b349e22f2b7a1419bc62097f1ae6fd89fd587d61;hpb=4de7e7dfae32128bde724e8cb6c7076f05cd3b1c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index b349e22f2..ca0e28f04 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -1,7 +1,9 @@ #pragma once #ifdef CSQC -#include +#include +#include +#include #endif @@ -211,7 +213,7 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object", false) default: case CMD_REQUEST_USAGE: { - LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index"); + LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get "); return; } } @@ -344,11 +346,11 @@ GENERIC_COMMAND(findent, "Search through entities for matching classname", false int entcnt = 0; FOREACH_ENTITY_CLASS_ORDERED(argv(1), true, { - LOG_INFOF("%i (%s)", it, it.classname); + LOG_HELPF("%i (%s)", it, it.classname); ++entcnt; }); if(entcnt) - LOG_INFOF("Found %d entities", entcnt); + LOG_HELPF("Found %d entities", entcnt); return; } @@ -356,8 +358,8 @@ GENERIC_COMMAND(findent, "Search through entities for matching classname", false LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0)); case CMD_REQUEST_USAGE: { - LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " find classname"); - LOG_HELP(" Where 'classname' is the classname to search for."); + LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " find "); + LOG_HELP(" Where is the classname to search for."); return; } } @@ -370,8 +372,23 @@ GENERIC_COMMAND(findat, "Search through entities for matching origin", false) { case CMD_REQUEST_COMMAND: { - vector match = stov(argv(1)); - FOREACH_ENTITY_ORDERED(it.origin == match, LOG_INFOF("%i (%s)", it, it.classname)); + vector org = stov(argv(1)); + float dist = stof(argv(2)); + 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); return; } @@ -379,7 +396,8 @@ GENERIC_COMMAND(findat, "Search through entities for matching origin", false) LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0)); case CMD_REQUEST_USAGE: { - LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " findat \"x y z\""); + LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " findat []"); + LOG_HELP(" Where is a vector \"x y z\""); return; } }