Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-19 12:34:31 -07:00
committed by GitHub
parent 5825ffb95c
commit f560f88eb5
261 changed files with 2291 additions and 2036 deletions

View File

@@ -1,7 +1,7 @@
using Content.Server.NPC.Components;
using Robust.Shared.Prototypes;
using System.Linq;
using Content.Server.NPC.Components;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server.NPC.Systems;
@@ -160,15 +160,15 @@ public sealed partial class NpcFactionSystem : EntitySystem
if (!xformQuery.TryGetComponent(entity, out var entityXform))
yield break;
foreach (var comp in _lookup.GetComponentsInRange<NpcFactionMemberComponent>(entityXform.MapPosition, range))
foreach (var ent in _lookup.GetEntitiesInRange<NpcFactionMemberComponent>(entityXform.MapPosition, range))
{
if (comp.Owner == entity)
if (ent.Owner == entity)
continue;
if (!factions.Overlaps(comp.Factions))
if (!factions.Overlaps(ent.Comp.Factions))
continue;
yield return comp.Owner;
yield return ent.Owner;
}
}