From c2686f3a388613df7fa25f3782937c6fc318994b Mon Sep 17 00:00:00 2001 From: dvize Date: Sat, 13 Apr 2024 20:24:35 -0700 Subject: [PATCH] Forgot to add back faceshield --- Component.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Component.cs b/Component.cs index c847927..3451ad5 100644 --- a/Component.cs +++ b/Component.cs @@ -81,6 +81,20 @@ namespace armorMod foreach (Item item in slotContents.ContainedItem.GetAllItems()) { + if (isArmor) + { + // Specifically for face shields, if the item has a FaceShieldComponent. + if (item.TryGetItemComponent(out var faceShield) && AssPlugin.fixFaceShieldBullets.Value) + { + // Check if face shield has been hit and reset hits if so. + if (faceShield.Hits > 0) + { + faceShield.Hits = 0; + faceShield.HitsChanged?.Invoke(); + } + } + } + if (item.TryGetItemComponent(out var component)) { float maxCap = isArmor ? AssPlugin.MaxDurabilityCap.Value : AssPlugin.weaponMaxDurabilityCap.Value;