]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/main.qc
Unify boolean constants
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / main.qc
index 589ff82a1122f000df835f78d1d4d9e2f8fe26d1..cd586b3cdf93b911a6b85bd52847e587834a5646 100644 (file)
@@ -12,11 +12,11 @@ void pathlib_deletepath(entity start)
 }
 
 //#define PATHLIB_NODEEXPIRE 0.05
-#define PATHLIB_NODEEXPIRE 20
+const float PATHLIB_NODEEXPIRE = 20;
 
 void dumpnode(entity n)
 {
-    n.is_path_node = FALSE;
+    n.is_path_node = false;
     n.think        = SUB_Remove;
     n.nextthink    = time;
 }
@@ -38,7 +38,7 @@ entity pathlib_mknode(vector where,entity parent)
 
     node.think        = SUB_Remove;
     node.nextthink    = time + PATHLIB_NODEEXPIRE;
-    node.is_path_node = TRUE;
+    node.is_path_node = true;
     node.owner        = openlist;
     node.path_prev    = parent;
 
@@ -157,7 +157,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go
     node = findradius(where,pathlib_gridsize * 0.5);
     while(node)
     {
-        if(node.is_path_node == TRUE)
+        if(node.is_path_node == true)
         {
             ++pathlib_merge_cnt;
             if(node.owner == openlist)
@@ -255,7 +255,7 @@ void pathlib_close_node(entity node,vector goal)
         if(pathlib_movenode_goodnode)
         {
             goal_node         = node;
-            pathlib_foundgoal = TRUE;
+            pathlib_foundgoal = true;
         }
     }
 }
@@ -268,7 +268,7 @@ void pathlib_cleanup()
 
     entity node;
 
-    node = findfloat(world,is_path_node, TRUE);
+    node = findfloat(world,is_path_node, true);
     while(node)
     {
         /*
@@ -280,7 +280,7 @@ void pathlib_cleanup()
         */
 
         dumpnode(node);
-        node = findfloat(node,is_path_node, TRUE);
+        node = findfloat(node,is_path_node, true);
     }
 
     if(openlist)
@@ -443,12 +443,12 @@ entity pathlib_astar(vector from,vector to)
     //movenode_maxdrop  = '0 0 512';
     movenode_boxup    = '0 0 72';
 
-    from_x = fsnap(from_x, pathlib_gridsize);
-    from_y = fsnap(from_y, pathlib_gridsize);
+    from_x = fsnap(from.x, pathlib_gridsize);
+    from_y = fsnap(from.y, pathlib_gridsize);
     //from_z += 32;
 
-    to_x = fsnap(to_x, pathlib_gridsize);
-    to_y = fsnap(to_y, pathlib_gridsize);
+    to_x = fsnap(to.x, pathlib_gridsize);
+    to_y = fsnap(to.y, pathlib_gridsize);
     //to_z += 32;
 
     dprint("AStar init\n");