]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean out self from some of the pathlib code
authorMario <mario@smbclan.net>
Sat, 21 May 2016 23:50:43 +0000 (09:50 +1000)
committerMario <mario@smbclan.net>
Sat, 21 May 2016 23:50:43 +0000 (09:50 +1000)
qcsrc/server/pathlib/expandnode.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/pathlib/utility.qc
qcsrc/server/pathlib/utility.qh

index 972c09c9782ce7372742ca9176d9f444105a6d97..700ba41c0e10ed9d7b203467d3d86f96288e4479 100644 (file)
@@ -102,7 +102,7 @@ float pathlib_expandnode_star(entity node, vector start, vector goal)
     r = PLIB_RIGHT   * pathlib_gridsize;
 
     if (node.pathlib_node_edgeflags == pathlib_node_edgeflag_unknown)
-        node.pathlib_node_edgeflags = tile_check_plus2(node.origin);
+        node.pathlib_node_edgeflags = tile_check_plus2(node, node.origin);
 
     if(node.pathlib_node_edgeflags == pathlib_node_edgeflag_none)
     {
index d0c70b2b88dff8e9ec43c838c5f2b7dc4eb9907b..20b4d994ae367f03ea387c1ef0df815a5de4a19d 100644 (file)
@@ -155,7 +155,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go
 
 
     if(doedge)
-        if (!tile_check(where))
+        if (!tile_check(parent, where))
         {
             LOG_TRACE("tile_check fail\n");
 #if DEBUGPATHING
index 7364440240e719e51afcbeaab3f9e5f41c36d32f..c2af5363b070eb782c562a87f171a5ea9a100e9a 100644 (file)
@@ -63,10 +63,10 @@ entity best_open_node;
 vector tile_check_up;
 vector tile_check_down;
 float  tile_check_size;
-float     tile_check_cross(vector where);
-float     tile_check_plus(vector where);
-float     tile_check_star(vector where);
-var float tile_check(vector where);
+float     tile_check_cross(entity this, vector where);
+float     tile_check_plus(entity this, vector where);
+float     tile_check_star(entity this, vector where);
+var float tile_check(entity this, vector where);
 
 float  movenode_stepsize;
 vector movenode_stepup;
index 9028f85e4f8be3ab4d65a21656634151522ecb4f..979b227b20096d0a23488112b2f49ddbbcb2a355 100644 (file)
@@ -71,8 +71,8 @@ entity pathlib_nodeatpoint(vector where)
     return world;
 }
 
-float tile_check_cross(vector where)
-{SELFPARAM();
+float tile_check_cross(entity this, vector where)
+{
     vector p,f,r;
 
     f = PLIB_FORWARD * tile_check_size;
@@ -81,33 +81,33 @@ float tile_check_cross(vector where)
 
     // forward-right
     p = where + f + r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (!location_isok(trace_endpos, 1, 0))
         return 0;
 
     // Forward-left
     p = where + f - r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (!location_isok(trace_endpos, 1, 0))
         return 0;
 
     // Back-right
     p = where - f + r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (!location_isok(trace_endpos, 1 ,0))
         return 0;
 
     //Back-left
     p = where - f - r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (!location_isok(trace_endpos, 1, 0))
         return 0;
 
     return 1;
 }
 
-float tile_check_plus(vector where)
-{SELFPARAM();
+float tile_check_plus(entity this, vector where)
+{
     vector p,f,r;
 
     f = PLIB_FORWARD * tile_check_size;
@@ -115,34 +115,34 @@ float tile_check_plus(vector where)
 
     // forward
     p = where + f;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (!location_isok(trace_endpos,1,0))
         return 0;
 
 
     //left
     p = where - r;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (!location_isok(trace_endpos,1,0))
         return 0;
 
     // Right
     p = where + r;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (!location_isok(trace_endpos,1,0))
         return 0;
 
     //Back
     p = where - f;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (!location_isok(trace_endpos,1,0))
         return 0;
 
     return 1;
 }
 
-float tile_check_plus2(vector where)
-{SELFPARAM();
+float tile_check_plus2(entity this, vector where)
+{
     vector p,f,r;
     float i = 0, e = 0;
 
@@ -156,7 +156,7 @@ float tile_check_plus2(vector where)
 
     // forward
     p = where + f;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (location_isok(trace_endpos,1,0))
     {
        ++i;
@@ -166,7 +166,7 @@ float tile_check_plus2(vector where)
 
     //left
     p = where - r;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (location_isok(trace_endpos,1,0))
     {
        ++i;
@@ -176,7 +176,7 @@ float tile_check_plus2(vector where)
 
     // Right
     p = where + r;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (location_isok(trace_endpos,1,0))
     {
        ++i;
@@ -185,7 +185,7 @@ float tile_check_plus2(vector where)
 
     //Back
     p = where - f;
-    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+    traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
     if (location_isok(trace_endpos,1,0))
     {
        ++i;
@@ -194,7 +194,7 @@ float tile_check_plus2(vector where)
 
     // forward-right
     p = where + f + r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (location_isok(trace_endpos, 1, 0))
     {
        ++i;
@@ -203,7 +203,7 @@ float tile_check_plus2(vector where)
 
     // Forward-left
     p = where + f - r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (location_isok(trace_endpos, 1, 0))
     {
        ++i;
@@ -212,7 +212,7 @@ float tile_check_plus2(vector where)
 
     // Back-right
     p = where - f + r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (location_isok(trace_endpos, 1 ,0))
     {
        ++i;
@@ -221,7 +221,7 @@ float tile_check_plus2(vector where)
 
     //Back-left
     p = where - f - r;
-    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+    traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
     if (location_isok(trace_endpos, 1, 0))
     {
        ++i;
@@ -235,10 +235,10 @@ float tile_check_plus2(vector where)
     return e;
 }
 
-float tile_check_star(vector where)
+float tile_check_star(entity this, vector where)
 {
-    if(tile_check_plus(where))
-        return tile_check_cross(where);
+    if(tile_check_plus(this, where))
+        return tile_check_cross(this, where);
 
     return 0;
 }
index 3544e86ca2b659125a3a99a3bfef5dab008e9f07..da4ace73e5bd14c56c9634d4753b2588595bb390 100644 (file)
@@ -2,4 +2,4 @@
 
 float fsnap(float val,float fsize);
 entity pathlib_nodeatpoint(vector where);
-float tile_check_plus2(vector where);
+float tile_check_plus2(entity this, vector where);