From 3d96b8dba04700128fde560ff953e11d428902ac Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Mon, 17 Feb 2014 17:03:34 -0500 Subject: [PATCH] Some cleanup --- qcsrc/common/weapons/w_arc.qc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 0e5902b58..d1c8ff2ec 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -194,20 +194,17 @@ void W_Arc_Beam_Think(void) // network information: beam direction self.SendFlags |= 4; - // this is where we calculate how many segments are needed + // calculate how many segments are needed float max_allowed_segments; - #if 1 if(WEP_CVAR(arc, beam_distancepersegment)) max_allowed_segments = min(ARC_MAX_SEGMENTS, 1 + (vlen(w_shotdir / WEP_CVAR(arc, beam_distancepersegment)))); else max_allowed_segments = ARC_MAX_SEGMENTS; - #endif if(WEP_CVAR(arc, beam_degreespersegment)) { segments = min( max(1, ( min(angle, WEP_CVAR(arc, beam_maxangle)) / WEP_CVAR(arc, beam_degreespersegment) ) ), max_allowed_segments ); - //segments = min( min(angle, WEP_CVAR(arc, beam_maxangle)) / WEP_CVAR(arc, beam_degreespersegment), max_allowed_segments ); } else { segments = 1; } } @@ -230,11 +227,11 @@ void W_Arc_Beam_Think(void) vector last_origin = w_shotorg; for(i = 1; i <= segments; ++i) { - // this could probably be calculated in a better way + // calculate this on every segment to ensure that we always reach the full length of the attack float segmentblend = (i/segments); float segmentdist = vlen(beam_endpos_estimate - last_origin) * (i/segments); - vector new_dir = normalize((w_shotdir * (1 - segmentblend)) + (normalize(beam_endpos_estimate - last_origin) * segmentblend)); + vector new_dir = normalize( (w_shotdir * (1 - segmentblend)) + (normalize(beam_endpos_estimate - last_origin) * segmentblend) ); vector new_origin = last_origin + (new_dir * segmentdist); WarpZone_traceline_antilag( -- 2.39.2