From: Mario Date: Tue, 26 Dec 2017 11:17:33 +0000 (+1000) Subject: Muffle weapon sounds slightly while dual wielding (ugly hax) X-Git-Tag: xonotic-v0.8.5~2407 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d21a9147a9a028641eacd0bed484e1f08e71b723;p=xonotic%2Fxonotic-data.pk3dir.git Muffle weapon sounds slightly while dual wielding (ugly hax) --- diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 157adb5d3..1d58aa75a 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -134,7 +134,14 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect ent.punchangle_x = recoil * -1; if (snd != SND_Null) { - sound (ent, chan, snd, VOL_BASE, ATTN_NORM); + int held_weapons = 0; // HACK: muffle weapon sounds slightly while dual wielding! + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + if(ent.(weaponentity) && ent.(weaponentity).m_switchweapon != WEP_Null) + ++held_weapons; + } + sound (ent, chan, snd, ((held_weapons > 1) ? VOL_BASE * 0.7 : VOL_BASE), ATTN_NORM); W_PlayStrengthSound(ent); }