From 1448d41e109ff70ace3f94929d038173d1be8e8d Mon Sep 17 00:00:00 2001 From: Link <131011403+LinkF2kkk@users.noreply.github.com> Date: Tue, 18 Mar 2025 09:12:00 +0300 Subject: [PATCH] maybe it works (#1018) Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> --- Content.Shared/Armor/SharedArmorSystem.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Content.Shared/Armor/SharedArmorSystem.cs b/Content.Shared/Armor/SharedArmorSystem.cs index 47e7ed6395..303a5ae01c 100644 --- a/Content.Shared/Armor/SharedArmorSystem.cs +++ b/Content.Shared/Armor/SharedArmorSystem.cs @@ -103,19 +103,19 @@ public abstract class SharedArmorSystem : EntitySystem //Merge old and new coefficients foreach (var (armorType, coefficient) in modifiers.Coefficients) { - if (armor.Modifiers.Coefficients.ContainsKey(armorType)) - armor.Modifiers.Coefficients[armorType] += coefficient; - else - armor.Modifiers.Coefficients[armorType] = coefficient; + if (!armor.Modifiers.Coefficients.ContainsKey(armorType)) + armor.Modifiers.Coefficients[armorType] = 1; + + armor.Modifiers.Coefficients[armorType] += coefficient; } //Merge old and new flat reductions foreach (var (armorType, reduction) in modifiers.FlatReduction) { - if (armor.Modifiers.FlatReduction.ContainsKey(armorType)) - armor.Modifiers.FlatReduction[armorType] += reduction; - else - armor.Modifiers.FlatReduction[armorType] = reduction; + if (!armor.Modifiers.FlatReduction.ContainsKey(armorType)) + armor.Modifiers.FlatReduction[armorType] = 0; + + armor.Modifiers.FlatReduction[armorType] += reduction; } } //CP14 public armor edit API end