X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fpathlib%2Fpathlib.qh;h=d0029bfc4809be08e2d93195781100a082c755ad;hb=1ba59bdc6b1e1ad0368f34dbd297e40cc42be243;hp=2616a77369fb767b5d6ca9c8f89ca0e60676ec83;hpb=54e0ccd220df67e999e1987086a0e2d8bc0ad10d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/pathlib/pathlib.qh b/qcsrc/server/pathlib/pathlib.qh index 2616a7736..d0029bfc4 100644 --- a/qcsrc/server/pathlib/pathlib.qh +++ b/qcsrc/server/pathlib/pathlib.qh @@ -1,3 +1,6 @@ +#ifndef PATHLIB_H +#define PATHLIB_H + .entity pathlib_list; .entity path_next; .entity path_prev; @@ -5,9 +8,9 @@ #define inwater(point) (pointcontents(point) == CONTENT_WATER) #define medium spawnshieldtime -#define PLIB_FORWARD '0 1 0' +const vector PLIB_FORWARD = '0 1 0'; //#define PLIB_BACK '0 -1 0' -#define PLIB_RIGHT '1 0 0' +const vector PLIB_RIGHT = '1 0 0'; //#define PLIB_LEFT '-1 0 0' #define DEBUGPATHING @@ -18,7 +21,6 @@ void pathlib_showpath2(entity path); entity openlist; entity closedlist; -entity edgelist; entity goal_node; entity start_node; @@ -29,16 +31,16 @@ entity start_node; .float pathlib_node_f; .float pathlib_node_c; -#define pathlib_node_edgeflag_unknown 0 -#define pathlib_node_edgeflag_left 2 -#define pathlib_node_edgeflag_right 4 -#define pathlib_node_edgeflag_forward 8 -#define pathlib_node_edgeflag_back 16 -#define pathlib_node_edgeflag_backleft 32 -#define pathlib_node_edgeflag_backright 64 -#define pathlib_node_edgeflag_forwardleft 128 -#define pathlib_node_edgeflag_forwardright 256 -#define pathlib_node_edgeflag_none 512 +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; .float pathlib_node_edgeflags; float pathlib_open_cnt; @@ -56,7 +58,7 @@ float pathlib_movecost_waterfactor; float pathlib_foundgoal; float pathlib_starttime; -#define pathlib_maxtime 60 +const float pathlib_maxtime = 60; entity best_open_node; @@ -76,9 +78,9 @@ vector movenode_boxmax; vector movenode_boxmin; float pathlib_movenode_goodnode; -vector pathlib_wateroutnode(vector start, vector end); -vector pathlib_swimnode(vector start, vector end); -vector pathlib_flynode(vector start, vector end); +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); @@ -106,7 +108,6 @@ 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); -var const float pathlib_wpp_wpcb_null(); #ifdef DEBUGPATHING #include "debug.qc" @@ -118,3 +119,4 @@ var const float pathlib_wpp_wpcb_null(); #include "expandnode.qc" #include "main.qc" #include "path_waypoint.qc" +#endif