Forgot to add back faceshield

This commit is contained in:
dvize
2024-04-13 20:24:35 -07:00
parent 91364aab2b
commit c2686f3a38

View File

@@ -81,6 +81,20 @@ namespace armorMod
foreach (Item item in slotContents.ContainedItem.GetAllItems()) foreach (Item item in slotContents.ContainedItem.GetAllItems())
{ {
if (isArmor)
{
// Specifically for face shields, if the item has a FaceShieldComponent.
if (item.TryGetItemComponent<FaceShieldComponent>(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<RepairableComponent>(out var component)) if (item.TryGetItemComponent<RepairableComponent>(out var component))
{ {
float maxCap = isArmor ? AssPlugin.MaxDurabilityCap.Value : AssPlugin.weaponMaxDurabilityCap.Value; float maxCap = isArmor ? AssPlugin.MaxDurabilityCap.Value : AssPlugin.weaponMaxDurabilityCap.Value;