X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fpathlib%2Futility.qc;h=ce12c1c631fed9bf994d4ace53a176cf776d540a;hb=15218c58cd7fc3878715aa71b8358a0ea0585638;hp=7a0aec8652ed0ae8f32b2594da45ad49459a6165;hpb=0f0e69c6625fc4db17559e2e47f2fdaed8298076;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 7a0aec865..ce12c1c63 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -1,18 +1,6 @@ -float fsnap(float val,float fsize) -{ - return rint(val / fsize) * fsize; -} - -vector vsnap(vector point,float fsize) -{ - vector vret; - - vret_x = rint(point_x / fsize) * fsize; - vret_y = rint(point_y / fsize) * fsize; - vret_z = ceil(point_z / fsize) * fsize; +#include "utility.qh" - return vret; -} +#include "pathlib.qh" float location_isok(vector point, float water_isok, float air_isok) { @@ -68,13 +56,13 @@ entity pathlib_nodeatpoint(vector where) ++pathlib_searched_cnt; - where_x = fsnap(where_x,pathlib_gridsize); - where_y = fsnap(where_y,pathlib_gridsize); + where.x = fsnap(where.x,pathlib_gridsize); + where.y = fsnap(where.y,pathlib_gridsize); node = findradius(where,pathlib_gridsize * 0.5); while(node) { - if(node.is_path_node == TRUE) + if(node.is_path_node == true) return node; node = node.chain;