From 18fab2e8cee449d264ccb36b44c1a5518145974e Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 21 Aug 2016 02:21:07 +1000 Subject: [PATCH] Some minor cleanup to unused functions --- qcsrc/server/steerlib.qc | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index 8064cd9ae..c69230d88 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -339,24 +339,30 @@ vector steerlib_traceavoid_flat(entity this, float pitch, float length, vector v return normalize(leftwish + rightwish + frontwish); } -float beamsweep_badpoint(vector point,float waterok) +bool beamsweep_badpoint(vector point, bool waterok) { - float pc,pc2; - if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) - return 1; - - pc = pointcontents(point); - pc2 = pointcontents(point - '0 0 1'); - - switch(pc) + return true; + + int pc = pointcontents(point); + int pc2 = pointcontents(point - '0 0 1'); + + if(pc == CONTENT_EMPTY && pc2 == CONTENT_SOLID) + return false; + if(pc == CONTENT_EMPTY && pc2 == CONTENT_WATER && waterok) + return false; + if(pc == CONTENT_WATER && waterok) + return false; + return true; + + /*switch(pc) { case CONTENT_SOLID: break; case CONTENT_SLIME: break; case CONTENT_LAVA: break; case CONTENT_SKY: - return 1; + return true; case CONTENT_EMPTY: if (pc2 == CONTENT_SOLID) @@ -375,14 +381,14 @@ float beamsweep_badpoint(vector point,float waterok) break; } - return 1; + return true;*/ } //#define BEAMSTEER_VISUAL float beamsweep(entity this, vector from, vector dir,float length, float step,float step_up, float step_down) { float i; - vector a,b,u,d; + vector a, b, u, d; u = '0 0 1' * step_up; d = '0 0 1' * step_down; @@ -464,8 +470,8 @@ vector steerlib_beamsteer(entity this, vector dir, float length, float step, flo if(bm_left + bm_right < 0.15) { - vr = normalize((v_forward*-1) + v_right * 0.75); - vl = normalize((v_forward*-1) - v_right * 0.75); + vr = normalize((v_forward*-1) + v_right * 0.90); + vl = normalize((v_forward*-1) - v_right * 0.90); bm_right = beamsweep(this, this.origin, vr, length, step, step_up, step_down); bm_left = beamsweep(this, this.origin, vl, length, step, step_up, step_down); -- 2.39.2