this.SendFlags |= ARC_SF_BEAMDIR;
// calculate how many segments are needed
- float max_allowed_segments;
-
+ float max_allowed_segments = ARC_MAX_SEGMENTS;
if(WEP_CVAR(arc, beam_distancepersegment))
{
- max_allowed_segments = min(
- ARC_MAX_SEGMENTS,
- 1 + (vlen(w_shotdir / WEP_CVAR(arc, beam_distancepersegment)))
- );
+ max_allowed_segments = 1 + (vlen(w_shotdir / WEP_CVAR(arc, beam_distancepersegment)));
+ max_allowed_segments = bound(1, max_allowed_segments, ARC_MAX_SEGMENTS);
}
- else { max_allowed_segments = ARC_MAX_SEGMENTS; }
if(WEP_CVAR(arc, beam_degreespersegment))
{
}
// calculate how many segments are needed
- float max_allowed_segments;
-
+ float max_allowed_segments = ARC_MAX_SEGMENTS;
if(this.beam_distancepersegment)
{
- max_allowed_segments = min(
- ARC_MAX_SEGMENTS,
- 1 + (vlen(wantdir / this.beam_distancepersegment))
- );
+ max_allowed_segments = 1 + (vlen(wantdir / this.beam_distancepersegment));
+ max_allowed_segments = bound(1, max_allowed_segments, ARC_MAX_SEGMENTS);
}
- else { max_allowed_segments = ARC_MAX_SEGMENTS; }
if(this.beam_degreespersegment)
{
float angle = vlen(wantdir - beamdir) * RAD2DEG;
// calculate how many segments are needed
- float max_allowed_segments;
-
+ float max_allowed_segments = ARC_MAX_SEGMENTS;
if(this.beam_distancepersegment)
{
- max_allowed_segments = min(
- ARC_MAX_SEGMENTS,
- 1 + (vlen(wantdir / this.beam_distancepersegment))
- );
+ max_allowed_segments = 1 + (vlen(wantdir / this.beam_distancepersegment));
+ max_allowed_segments = bound(1, max_allowed_segments, ARC_MAX_SEGMENTS);
}
- else { max_allowed_segments = ARC_MAX_SEGMENTS; }
if(this.beam_degreespersegment)
{