Fixed dedicated servers ignoring armor

This commit is contained in:
Joonas Rikkonen
2017-07-24 19:12:18 +03:00
parent 96c4379f9f
commit 379c65e07d
@@ -363,22 +363,23 @@ namespace Barotrauma
} }
} }
#if CLIENT
float bloodAmount = hitArmor || bleedingAmount <= 0.0f ? 0 : (int)Math.Min((int)(amount * 2.0f), 20);
DamageSoundType damageSoundType = (damageType == DamageType.Blunt) ? DamageSoundType.LimbBlunt : DamageSoundType.LimbSlash;
if (hitArmor) if (hitArmor)
{ {
totalArmorValue = Math.Max(totalArmorValue, 0.0f); totalArmorValue = Math.Max(totalArmorValue, 0.0f);
damageSoundType = DamageSoundType.LimbArmor;
amount = Math.Max(0.0f, amount - totalArmorValue); amount = Math.Max(0.0f, amount - totalArmorValue);
bleedingAmount = Math.Max(0.0f, bleedingAmount - totalArmorValue); bleedingAmount = Math.Max(0.0f, bleedingAmount - totalArmorValue);
} }
#if CLIENT
if (playSound) if (playSound)
{ {
DamageSoundType damageSoundType = (damageType == DamageType.Blunt) ? DamageSoundType.LimbBlunt : DamageSoundType.LimbSlash;
if (hitArmor)
{
damageSoundType = DamageSoundType.LimbArmor;
}
SoundPlayer.PlayDamageSound(damageSoundType, amount, position); SoundPlayer.PlayDamageSound(damageSoundType, amount, position);
} }