X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fpathlib%2Futility.qc;h=73d109e60139ee80cdcff18ce00d21c0f317721c;hb=ce80a3d3800ee2f5ce8a8d93ccb6b835a46ec5f6;hp=9ebaac9f275830a8115f4ac661165cd8f4235a6b;hpb=0d7723492be564b7819186b2b1ec646c7e543572;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 9ebaac9f2..73d109e60 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -1,6 +1,8 @@ #include "utility.qh" -#include "pathlib.qh" +#include +#include +#include bool location_isok(vector point, bool waterok, bool air_isok) { @@ -28,12 +30,14 @@ entity pathlib_nodeatpoint(vector where) where.x = fsnap(where.x,pathlib_gridsize); where.y = fsnap(where.y,pathlib_gridsize); - FOREACH_ENTITY_RADIUS(where, pathlib_gridsize * 0.5, it.is_path_node, + entity found = NULL; // TODO: using FOREACH_ENTITY_RADIUS here causes mutex loop warnings, this may need a proper fix! + IL_EACH(g_pathlib_nodes, it.is_path_node && vdist(it.origin - where, <, pathlib_gridsize * 0.5), { - return it; + found = it; + break; }); - return NULL; + return found; } bool tile_check_cross(entity this, vector where)