From 7328074a9fe59f30aa97d40beafc31bf7b1f089c Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 3 Mar 2018 16:33:45 +1000 Subject: [PATCH] Use the actual shot tag when possible --- qcsrc/common/weapons/weapon/arc.qc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index e4c82748e..1f804a67a 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -896,6 +896,7 @@ void Draw_ArcBeam(entity this) vector forward = v_forward; vector right = v_right; vector up = v_up; + entity wepent = viewmodels[this.beam_slot]; // decide upon start position if(this.beam_usevieworigin == 2) @@ -903,6 +904,11 @@ void Draw_ArcBeam(entity this) else { start_pos = this.origin; } + int v_shot_idx; // used later + (v_shot_idx = gettagindex(wepent, "shot")) || (v_shot_idx = gettagindex(wepent, "tag_shot")); + if(v_shot_idx) + start_pos = gettaginfo(wepent, v_shot_idx) - '0 0 2'; + // trace forward with an estimation WarpZone_TraceLine( start_pos, @@ -918,13 +924,17 @@ void Draw_ArcBeam(entity this) if(vdist(end_pos - start_pos, <, g_trueaim_minrange)) end_pos = start_pos + (forward * g_trueaim_minrange); - entity wepent = viewmodels[this.beam_slot]; - this.beam_shotorigin = wepent.movedir; - // move shot origin to the actual gun muzzle origin - vector origin_offset = - right * -this.beam_shotorigin.y - + up * this.beam_shotorigin.z; + vector origin_offset = '0 0 0'; + if(!v_shot_idx) + { + this.beam_shotorigin = wepent.movedir; + origin_offset = + right * -this.beam_shotorigin.y + + up * this.beam_shotorigin.z; + } + else + this.beam_shotorigin = '0 0 0'; start_pos = start_pos + origin_offset; -- 2.39.2