From c69afe1578206fb21b736e0c2bb1394d7a13b35f Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 12 Jun 2018 00:48:35 +1000 Subject: [PATCH] Revert "Potential fix for arc's buffer overflow issue (hacky method)" This reverts commit d35415a2feca70c00f7e009e290513a5a0b48014. --- qcsrc/common/weapons/weapon/arc.qc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 3fe93fe4c..e5d4f2eb2 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -863,8 +863,6 @@ void Reset_ArcBeam() } } -.float beam_tag_index; -.int beam_prevusevieworigin; void Draw_ArcBeam(entity this) { float dt = time - this.move_time; @@ -913,16 +911,10 @@ void Draw_ArcBeam(entity this) else { start_pos = this.origin; } - if(this.beam_prevusevieworigin != this.beam_usevieworigin) - { - this.beam_prevusevieworigin = this.beam_usevieworigin; - int v_shot_idx; // used later - (v_shot_idx = gettagindex(wepent, "shot")) || (v_shot_idx = gettagindex(wepent, "tag_shot")); - this.beam_tag_index = v_shot_idx; - } - - if(this.beam_tag_index && this.beam_usevieworigin == 2) - start_pos = gettaginfo(wepent, this.beam_tag_index) - '0 0 2'; + int v_shot_idx; // used later + (v_shot_idx = gettagindex(wepent, "shot")) || (v_shot_idx = gettagindex(wepent, "tag_shot")); + if(v_shot_idx && this.beam_usevieworigin == 2) + start_pos = gettaginfo(wepent, v_shot_idx) - '0 0 2'; // trace forward with an estimation WarpZone_TraceLine( @@ -941,7 +933,7 @@ void Draw_ArcBeam(entity this) // move shot origin to the actual gun muzzle origin vector origin_offset = '0 0 0'; - if(!this.beam_tag_index || this.beam_usevieworigin != 2) + if(!v_shot_idx || this.beam_usevieworigin != 2) { this.beam_shotorigin = wepent.movedir; origin_offset = -- 2.39.2