From 27890bd829f5a4ace9522439a2f785355f7ab7e3 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:02:34 +0300 Subject: [PATCH] Update FactionClothingSystem.cs (#1659) --- .../Clothing/EntitySystems/FactionClothingSystem.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Content.Shared/Clothing/EntitySystems/FactionClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/FactionClothingSystem.cs index 76b7b9aa66d..cbc7cf724ca 100644 --- a/Content.Shared/Clothing/EntitySystems/FactionClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/FactionClothingSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Inventory.Events; using Content.Shared.NPC.Components; using Content.Shared.NPC.Systems; +using Robust.Shared.Player; // Frontier - Dont edit AI factions namespace Content.Shared.Clothing.EntitySystems; @@ -22,6 +23,9 @@ public override void Initialize() private void OnEquipped(Entity ent, ref GotEquippedEvent args) { + if (!HasComp(args.Equipee)) // Frontier - Dont edit AI factions + return; // Frontier - Dont edit AI factions + TryComp(args.Equipee, out var factionComp); var faction = (args.Equipee, factionComp); ent.Comp.AlreadyMember = _faction.IsMember(faction, ent.Comp.Faction); @@ -31,6 +35,9 @@ private void OnEquipped(Entity ent, ref GotEquippedEve private void OnUnequipped(Entity ent, ref GotUnequippedEvent args) { + if (!HasComp(args.Equipee)) // Frontier - Dont edit AI factions + return; // Frontier - Dont edit AI factions + if (ent.Comp.AlreadyMember) { ent.Comp.AlreadyMember = false;