Rename Faction to NpcFaction (#18079)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user