diff --git a/Content.Server/NPC/Systems/NpcFactionSystem.cs b/Content.Server/NPC/Systems/NpcFactionSystem.cs index bfc4add577..79c4bbc7af 100644 --- a/Content.Server/NPC/Systems/NpcFactionSystem.cs +++ b/Content.Server/NPC/Systems/NpcFactionSystem.cs @@ -111,6 +111,20 @@ public sealed class NpcFactionSystem : EntitySystem } } + /// + /// Remove this entity from all factions. + /// + public void ClearFactions(EntityUid uid, bool dirty = true) + { + if (!TryComp(uid, out var component)) + return; + + component.Factions.Clear(); + + if (dirty) + RefreshFactions(component); + } + public IEnumerable GetNearbyHostiles(EntityUid entity, float range, NpcFactionMemberComponent? component = null) { if (!Resolve(entity, ref component, false))