From c4f5176af4862e3247ffe9011d0348887d36091e Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 18 Feb 2015 15:04:57 -0600 Subject: [PATCH] Set bsp_trace_t::surface.flags to surfaceFlags in server and game Revert last commit so that grapple sky check is compatible with BSPC BotImport_Trace in (removed from repo) code/bspc/be_aas_bspq3.c. Set bsp_trace_t::surface.flags instead of surface.value to trace_t::surfaceFlags. surface.flags is only used for the sky check for grapple AAS reachability. surface.value is not used at all. bsp_trace_t is not part of the game VM API, so this does not affect VM compatibility. BotAI_Trace in game was changed to match server. surface.value/flags are not used in game. --- code/botlib/be_aas_reach.c | 2 +- code/game/ai_main.c | 3 ++- code/server/sv_bot.c | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/botlib/be_aas_reach.c b/code/botlib/be_aas_reach.c index 5452ea4c..379948aa 100644 --- a/code/botlib/be_aas_reach.c +++ b/code/botlib/be_aas_reach.c @@ -3857,7 +3857,7 @@ int AAS_Reachability_Grapple(int area1num, int area2num) // bsptrace = AAS_Trace(start, NULL, NULL, end, 0, CONTENTS_SOLID); //the grapple won't stick to the sky and the grapple point should be near the AAS wall - if ((bsptrace.surface.value & SURF_SKY) || (bsptrace.fraction * 500 > 32)) continue; + if ((bsptrace.surface.flags & SURF_SKY) || (bsptrace.fraction * 500 > 32)) continue; //trace a full bounding box from the area center on the ground to //the center of the face VectorSubtract(facecenter, areastart, dir); diff --git a/code/game/ai_main.c b/code/game/ai_main.c index 9c6fe3a7..48958d8a 100644 --- a/code/game/ai_main.c +++ b/code/game/ai_main.c @@ -149,7 +149,8 @@ void BotAI_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec3_t maxs, VectorCopy(trace.plane.normal, bsptrace->plane.normal); bsptrace->plane.signbits = trace.plane.signbits; bsptrace->plane.type = trace.plane.type; - bsptrace->surface.value = trace.surfaceFlags; + bsptrace->surface.value = 0; + bsptrace->surface.flags = trace.surfaceFlags; bsptrace->ent = trace.entityNum; bsptrace->exp_dist = 0; bsptrace->sidenum = 0; diff --git a/code/server/sv_bot.c b/code/server/sv_bot.c index eb7089e1..d92dfcaf 100644 --- a/code/server/sv_bot.c +++ b/code/server/sv_bot.c @@ -188,7 +188,8 @@ static void BotImport_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, ve VectorCopy(trace.plane.normal, bsptrace->plane.normal); bsptrace->plane.signbits = trace.plane.signbits; bsptrace->plane.type = trace.plane.type; - bsptrace->surface.value = trace.surfaceFlags; + bsptrace->surface.value = 0; + bsptrace->surface.flags = trace.surfaceFlags; bsptrace->ent = trace.entityNum; bsptrace->exp_dist = 0; bsptrace->sidenum = 0; @@ -213,7 +214,8 @@ static void BotImport_EntityTrace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mi VectorCopy(trace.plane.normal, bsptrace->plane.normal); bsptrace->plane.signbits = trace.plane.signbits; bsptrace->plane.type = trace.plane.type; - bsptrace->surface.value = trace.surfaceFlags; + bsptrace->surface.value = 0; + bsptrace->surface.flags = trace.surfaceFlags; bsptrace->ent = trace.entityNum; bsptrace->exp_dist = 0; bsptrace->sidenum = 0;