X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fpathlib%2Fpath_waypoint.qc;h=f86c270b04b3e32ad6ff14294190983f7e7ca699;hb=d2bda4ac404ae8e0e58bb5371d9d1f62196e8d1e;hp=231c14f21bbbf6b6c8464a62d857ba593394116d;hpb=e3507f4fdbc2b3e15b663365e57e0aa60f3cf1a6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index 231c14f21..f86c270b0 100644 --- a/qcsrc/server/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -1,3 +1,9 @@ +#include "path_waypoint.qh" +#include "../bot/waypoints.qh" + +#include "pathlib.qh" +#include "main.qh" + var float pathlib_wpp_open(entity wp, entity child, float cost); void pathlib_wpp_close(entity wp) @@ -158,7 +164,7 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) pathlib_searched_cnt = 0; pathlib_foundgoal = false; - dprint("pathlib_waypointpath init\n"); + LOG_TRACE("pathlib_waypointpath init\n"); // Initialize waypoint grid // FIXME! presisted chain for better preformance @@ -180,10 +186,10 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) start_node = wp_from; start_node.pathlib_list = closedlist; - dprint("Expanding ",ftos(pathlib_wpp_expand(start_node))," links\n"); + LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(start_node))," links\n"); if(pathlib_open_cnt <= 0) { - dprint("pathlib_waypointpath: Start waypoint not linked! aborting.\n"); + LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.\n"); return world; } @@ -197,17 +203,17 @@ entity pathlib_waypointpath_step() n = pathlib_wpp_bestopen(); if(!n) { - dprint("Cannot find best open node, abort.\n"); + LOG_TRACE("Cannot find best open node, abort.\n"); return world; } pathlib_wpp_close(n); - dprint("Expanding ",ftos(pathlib_wpp_expand(n))," links\n"); + LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links\n"); if(pathlib_foundgoal) { entity start, end, open, ln; - dprint("Target found. Rebuilding and filtering path...\n"); + LOG_TRACE("Target found. Rebuilding and filtering path...\n"); buildpath_nodefilter = buildpath_nodefilter_none; start = path_build(world, start_node.origin, world, world); @@ -228,18 +234,18 @@ entity pathlib_waypointpath_step() return world; } -void plas_think() +void plas_think(entity this) { pathlib_waypointpath_step(); if(pathlib_foundgoal) return; - self.nextthink = time + 0.1; + this.nextthink = time + 0.1; } void pathlib_waypointpath_autostep() { entity n; n = spawn(); - n.think = plas_think; + setthink(n, plas_think); n.nextthink = time + 0.1; }