Rename Faction to NpcFaction (#18079)

This commit is contained in:
Leon Friedrich
2023-07-17 15:51:52 +12:00
committed by GitHub
parent f8c94bd76c
commit 541eb417e3
37 changed files with 108 additions and 109 deletions

View File

@@ -483,7 +483,7 @@ public sealed partial class NPCSteeringSystem
var objectRadius = 0.25f;
var detectionRadius = MathF.Max(0.35f, agentRadius + objectRadius);
var ourVelocity = body.LinearVelocity;
var factionQuery = GetEntityQuery<FactionComponent>();
var factionQuery = GetEntityQuery<NpcFactionMemberComponent>();
factionQuery.TryGetComponent(uid, out var ourFaction);
foreach (var ent in _lookup.GetEntitiesInRange(uid, detectionRadius, LookupFlags.Dynamic))
@@ -496,7 +496,7 @@ public sealed partial class NPCSteeringSystem
(mask & otherBody.CollisionLayer) == 0x0 &&
(layer & otherBody.CollisionMask) == 0x0 ||
!factionQuery.TryGetComponent(ent, out var otherFaction) ||
!_faction.IsEntityFriendly(uid, ent, ourFaction, otherFaction) ||
!_npcFaction.IsEntityFriendly(uid, ent, ourFaction, otherFaction) ||
// Use <= 0 so we ignore stationary friends in case.
Vector2.Dot(otherBody.LinearVelocity, ourVelocity) <= 0f)
{