diff --git a/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs b/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs index 46ac49862b..0768e91595 100755 --- a/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs +++ b/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using RimWorld; @@ -351,7 +351,13 @@ private static bool TryPenetrateArmor(DamageDef def, float armorAmount, ref floa { if (penAmount == 0 || armorAmount == 0) { - if (armor.GetStatValue(StatDefOf.ArmorRating_Sharp) == 0 && armor.GetStatValue(StatDefOf.ArmorRating_Blunt) == 0 && armor.GetStatValue(StatDefOf.ArmorRating_Heat) == 0) + // Skip error logging for utility stuff + var layers = armor.def.apparel?.layers; + bool isUtilityApparel = layers?.Count == 1 && + (layers[0] == CE_ApparelLayerDefOf.StrappedHead || + layers[0] == CE_ApparelLayerDefOf.Webbing || + layers[0] == CE_ApparelLayerDefOf.Backpack); + if (!isUtilityApparel && armor.GetStatValue(StatDefOf.ArmorRating_Sharp) == 0 && armor.GetStatValue(StatDefOf.ArmorRating_Blunt) == 0 && armor.GetStatValue(StatDefOf.ArmorRating_Heat) == 0) { Log.ErrorOnce($"penAmount or armorAmount are zero for {def.armorCategory} on {armor}", armor.def.GetHashCode() + 846532021); }