X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=ca0e28f04680e24b4585ebf41f88b0b9bed2d0b5;hb=eb7abbb160df6ad5678da8abd132817747e520dd;hp=5d92a5a6391980fdfcfa7ac9ecb57695f238e75c;hpb=837c32688ad1f1548e7d4cf4339691181c2bb6ff;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 5d92a5a63..ca0e28f04 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -2,8 +2,8 @@ #ifdef CSQC #include -#include #include +#include #endif @@ -213,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; } } @@ -346,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; } @@ -358,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; } } @@ -372,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; } @@ -381,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; } }