]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/path_waypoint.qc
Merge branch 'master' into Mario/entrap_nade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / path_waypoint.qc
index 231c14f21bbbf6b6c8464a62d857ba593394116d..f86c270b04b3e32ad6ff14294190983f7e7ca699 100644 (file)
@@ -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;
 }