Skip to content

Commit

Permalink
Merge pull request #3366 from CombatExtended-Continued/ArmorDurabilit…
Browse files Browse the repository at this point in the history
…yApplyDamageFix

Armor durability apply damage fix for non-health damaging or non external violence damage
  • Loading branch information
N7Huntsman authored Aug 24, 2024
2 parents 038b3c5 + 6248166 commit 7461caa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public override string CompInspectStringExtra()
public override void PostPreApplyDamage(ref DamageInfo dinfo, out bool absorbed)
{
base.PostPreApplyDamage(ref dinfo, out absorbed);
if (curDurability > 0)
if (curDurability > 0 && dinfo.Def.harmsHealth && dinfo.Def.ExternalViolenceFor(parent))
{
curDurability -= dinfo.Amount;
if (curDurability < 0)
Expand Down

0 comments on commit 7461caa

Please sign in to comment.