X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fpathlib%2Fpathlib.qh;h=765fe2a7f201b6bfa6b1e1da7e70c0cac3284d31;hb=f0e85d42bcc9a3e6b2fa6ea8b825ca2dfc60fb1f;hp=71d13caa4e084660b568389f7f96031e54bfafc1;hpb=6d6a01255c7a5c146bbeb3daae6f527dd40f98d4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/pathlib/pathlib.qh b/qcsrc/server/pathlib/pathlib.qh index 71d13caa4..765fe2a7f 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,12 +8,11 @@ #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 #ifdef DEBUGPATHING void pathlib_showpath(entity start); void pathlib_showpath2(entity path); @@ -28,16 +30,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 = 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; @@ -55,7 +57,7 @@ float pathlib_movecost_waterfactor; float pathlib_foundgoal; float pathlib_starttime; -#define pathlib_maxtime 60 +const float pathlib_maxtime = 60; entity best_open_node; @@ -75,9 +77,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,13 +108,4 @@ 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"