]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If an attack would be fatal, don't play the armor hit sound
authorMario <mario@smbclan.net>
Wed, 4 Sep 2019 09:37:51 +0000 (19:37 +1000)
committerMario <mario@smbclan.net>
Wed, 4 Sep 2019 09:37:51 +0000 (19:37 +1000)
qcsrc/server/player.qc

index c39f59e7213d3edad4bcbab165b01e7e091ccff5..9e67050cb654b23c9847c8b2e94bda0f1898b106 100644 (file)
@@ -398,7 +398,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
 
        if(sound_allowed(MSG_BROADCAST, attacker))
        {
-               if (save > 10)
+               if (save > 10 && (dh - take) > 0) // don't play armor sound if the attack is fatal
                        sound (this, CH_SHOTS, SND_ARMORIMPACT, VOL_BASE, ATTEN_NORM);
                else if (take > 30)
                        sound (this, CH_SHOTS, SND_BODYIMPACT2, VOL_BASE, ATTEN_NORM);