]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/utility.qc
Merge branch 'master' into terencehill/glowmod_color_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / utility.qc
index 9ebaac9f275830a8115f4ac661165cd8f4235a6b..73d109e60139ee80cdcff18ce00d21c0f317721c 100644 (file)
@@ -1,6 +1,8 @@
 #include "utility.qh"
 
-#include "pathlib.qh"
+#include <common/stats.qh>
+#include <common/weapons/_all.qh>
+#include <server/pathlib/pathlib.qh>
 
 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)