]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Muffle weapon sounds slightly while dual wielding (ugly hax)
authorMario <mario@smbclan.net>
Tue, 26 Dec 2017 11:17:33 +0000 (21:17 +1000)
committerMario <mario@smbclan.net>
Tue, 26 Dec 2017 11:17:33 +0000 (21:17 +1000)
qcsrc/server/weapons/tracing.qc

index 157adb5d399c976dca3da949c257c272c3b182d3..1d58aa75a5d9d4319e01d9a1d9f484cc4a3df272 100644 (file)
@@ -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);
        }