Context steering for NPCs (#12915)

This commit is contained in:
metalgearsloth
2022-12-12 14:33:43 +11:00
committed by GitHub
parent 881ba0d48d
commit 7910bd3ff4
17 changed files with 952 additions and 228 deletions

View File

@@ -139,6 +139,14 @@ namespace Content.Server.NPC.Systems
}
}
public bool IsFriendly(EntityUid uidA, EntityUid uidB, FactionComponent? factionA = null, FactionComponent? factionB = null)
{
if (!Resolve(uidA, ref factionA, false) || !Resolve(uidB, ref factionB, false))
return false;
return factionA.Factions.Overlaps(factionB.Factions) || factionA.FriendlyFactions.Overlaps(factionB.Factions);
}
/// <summary>
/// Makes the source faction friendly to the target faction, 1-way.
/// </summary>