Cursed Mask (#29659)

* Cursed Mask

* extra expressions

* block ingestion

* mind returning

* okay fix the removal shit
This commit is contained in:
Nemanja
2024-08-10 11:14:58 -04:00
committed by GitHub
parent 53058df8b9
commit fc1446e73a
20 changed files with 412 additions and 0 deletions

View File

@@ -100,6 +100,28 @@ public sealed partial class NpcFactionSystem : EntitySystem
RefreshFactions((ent, ent.Comp));
}
/// <summary>
/// Adds this entity to the particular faction.
/// </summary>
public void AddFactions(Entity<NpcFactionMemberComponent?> ent, HashSet<ProtoId<NpcFactionPrototype>> factions, bool dirty = true)
{
ent.Comp ??= EnsureComp<NpcFactionMemberComponent>(ent);
foreach (var faction in factions)
{
if (!_proto.HasIndex(faction))
{
Log.Error($"Unable to find faction {faction}");
continue;
}
ent.Comp.Factions.Add(faction);
}
if (dirty)
RefreshFactions((ent, ent.Comp));
}
/// <summary>
/// Removes this entity from the particular faction.
/// </summary>