]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/pathlib.qh
Merge branch 'terencehill/v_deathtilt_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / pathlib.qh
index d0029bfc4809be08e2d93195781100a082c755ad..a5f36da4a349d0059bfdc7846e98409847951b52 100644 (file)
@@ -1,20 +1,18 @@
-#ifndef PATHLIB_H
-#define PATHLIB_H
+#pragma once
 
 .entity pathlib_list;
 .entity path_next;
 .entity path_prev;
 
 #define inwater(point) (pointcontents(point) == CONTENT_WATER)
-#define medium spawnshieldtime
+.int medium;
 
 const vector PLIB_FORWARD = '0 1 0';
 //#define PLIB_BACK    '0 -1 0'
 const vector PLIB_RIGHT = '1 0 0';
 //#define PLIB_LEFT    '-1 0 0'
 
-#define DEBUGPATHING
-#ifdef DEBUGPATHING
+#if DEBUGPATHING
 void pathlib_showpath(entity start);
 void pathlib_showpath2(entity path);
 #endif
@@ -32,15 +30,15 @@ entity start_node;
 .float pathlib_node_c;
 
 const float pathlib_node_edgeflag_unknown              = 0;
-const float pathlib_node_edgeflag_left                         = 2;
-const float pathlib_node_edgeflag_right                = 4;
-const float pathlib_node_edgeflag_forward              = 8;
-const float pathlib_node_edgeflag_back                         = 16;
-const float pathlib_node_edgeflag_backleft             = 32;
-const float pathlib_node_edgeflag_backright    = 64;
-const float pathlib_node_edgeflag_forwardleft  = 128;
-const float pathlib_node_edgeflag_forwardright         = 256;
-const float pathlib_node_edgeflag_none                         = 512;
+const float pathlib_node_edgeflag_left                         = BIT(1);
+const float pathlib_node_edgeflag_right                = BIT(2);
+const float pathlib_node_edgeflag_forward              = BIT(3);
+const float pathlib_node_edgeflag_back                         = BIT(4);
+const float pathlib_node_edgeflag_backleft             = BIT(5);
+const float pathlib_node_edgeflag_backright    = BIT(6);
+const float pathlib_node_edgeflag_forwardleft  = BIT(7);
+const float pathlib_node_edgeflag_forwardright         = BIT(8);
+const float pathlib_node_edgeflag_none                         = BIT(9);
 .float pathlib_node_edgeflags;
 
 float pathlib_open_cnt;
@@ -65,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;
@@ -78,11 +76,11 @@ vector movenode_boxmax;
 vector movenode_boxmin;
 float  pathlib_movenode_goodnode;
 
-vector     pathlib_wateroutnode(vector start, vector end, float doedge);
-vector     pathlib_swimnode(vector start, vector end, float doedge);
-vector     pathlib_flynode(vector start, vector end, float doedge);
-vector     pathlib_walknode(vector start, vector end, float doedge);
-var vector pathlib_movenode(vector start, vector end, float doedge);
+vector     pathlib_wateroutnode(entity this, vector start, vector end, float doedge);
+vector     pathlib_swimnode(entity this, vector start, vector end, float doedge);
+vector     pathlib_flynode(entity this, vector start, vector end, float doedge);
+vector     pathlib_walknode(entity this, vector start, vector end, float doedge);
+var vector pathlib_movenode(entity this, vector start, vector end, float doedge);
 
 float      pathlib_expandnode_star(entity node, vector start, vector goal);
 float      pathlib_expandnode_box(entity node, vector start, vector goal);
@@ -108,15 +106,3 @@ var float  pathlib_makenode(entity parent,vector start, vector to, vector goal,f
 var float  buildpath_nodefilter(vector n,vector c,vector p);
 
 var float  pathlib_wpp_waypointcallback(entity wp, entity wp_prev);
-
-#ifdef DEBUGPATHING
-       #include "debug.qc"
-#endif
-
-#include "utility.qc"
-#include "movenode.qc"
-#include "costs.qc"
-#include "expandnode.qc"
-#include "main.qc"
-#include "path_waypoint.qc"
-#endif