From 9925427ac97054b860843d88c330c203dfe1bf6e Mon Sep 17 00:00:00 2001 From: Eukara Date: Sat, 2 Jan 2021 10:13:59 +0000 Subject: [PATCH] export waypoint radius to the route-data passed onto QC, this will change nodeslist_t git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5797 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/pr_cmds.c | 1 + engine/server/sv_move.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index b017dddb9..38fa47364 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -11149,6 +11149,7 @@ static BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs "typedef struct\n{\n" \ "\tvector dest;\n" \ "\tint linkflags;\n"\ + "\tfloat radius;\n"\ "} nodeslist_t;\n" {"route_calculate", PF_route_calculate,0, 0, 0, 0, D(qcnodeslist "void(entity ent, vector dest, int denylinkflags, void(entity ent, vector dest, int numnodes, nodeslist_t *nodelist) callback)", "Begin calculating a route. The callback function will be called once the route has finished being calculated. The route must be memfreed once it is no longer needed. The route must be followed in reverse order (ie: the first node that must be reached is at index numnodes-1). If no route is available then the callback will be called with no nodes.")}, #endif diff --git a/engine/server/sv_move.c b/engine/server/sv_move.c index 7dbef3f9e..9181d0604 100644 --- a/engine/server/sv_move.c +++ b/engine/server/sv_move.c @@ -647,6 +647,7 @@ struct waypointnetwork_s { vec3_t pos; int linkflags; + float radius; } *displaynode; size_t displaynodes; @@ -884,6 +885,7 @@ static qboolean Route_Completed(struct routecalc_s *r, nodefrom_t *nodecamefrom) //target point is first. yay. VectorCopy(r->end, r->resultnodes[0].pos); r->resultnodes[0].linkflags = LF_DESTINATION; + r->resultnodes[0].radius = 32; r->numresultnodes++; u = r->endn; @@ -891,6 +893,7 @@ static qboolean Route_Completed(struct routecalc_s *r, nodefrom_t *nodecamefrom) { VectorCopy(n->waypoints[u].org, r->resultnodes[r->numresultnodes].pos); r->resultnodes[r->numresultnodes].linkflags = nodecamefrom[u].flags; + r->resultnodes[r->numresultnodes].radius = n->waypoints[u].radius; r->numresultnodes++; if (u == r->startn) break; @@ -900,6 +903,7 @@ static qboolean Route_Completed(struct routecalc_s *r, nodefrom_t *nodecamefrom) //and include the start point, because we can VectorCopy(r->start, r->resultnodes[r->numresultnodes].pos); r->resultnodes[r->numresultnodes].linkflags = 0; + r->resultnodes[r->numresultnodes].radius = 32; r->numresultnodes++; return true; }