From 11ac0d23b5ad3e7dc02389550f53b708cc13afce Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 5 Oct 2016 21:52:41 +1000 Subject: [PATCH] Find arc if held, to support hit sounds --- qcsrc/client/view.qc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 93c632e70..f83dfab36 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -817,11 +817,18 @@ void HitSound() { // varying sound pitch - entity wepent = viewmodels[0]; // TODO: unhardcode + bool have_arc = false; + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + entity wepent = viewmodels[slot]; + + if(wepent.activeweapon == WEP_ARC) + have_arc = true; + } static float hitsound_time_prev = 0; // HACK: the only way to get the arc to sound consistent with pitch shift is to ignore cl_hitsound_antispam_time - float arc_hack = wepent.activeweapon == WEP_ARC && autocvar_cl_hitsound >= 2; + bool arc_hack = have_arc && autocvar_cl_hitsound >= 2; if (arc_hack || COMPARE_INCREASING(time, hitsound_time_prev) > autocvar_cl_hitsound_antispam_time) { if (autocvar_cl_hitsound && unaccounted_damage) -- 2.39.2