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,9 +1,8 @@
using Content.Server.Polymorph.Systems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.Humanoid;
using Content.Server.Polymorph.Systems;
using Content.Shared.Mobs.Systems;
using Content.Shared.Polymorph;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
@@ -28,7 +27,10 @@ public sealed class PolyArtifactSystem : EntitySystem
private void OnActivate(EntityUid uid, PolyArtifactComponent component, ArtifactActivatedEvent args)
{
var xform = Transform(uid);
foreach (var comp in _lookup.GetComponentsInRange<HumanoidAppearanceComponent>(xform.Coordinates, component.Range))
var humanoids = new HashSet<Entity<HumanoidAppearanceComponent>>();
_lookup.GetEntitiesInRange(xform.Coordinates, component.Range, humanoids);
foreach (var comp in humanoids)
{
var target = comp.Owner;
if (_mob.IsAlive(target))

View File

@@ -23,7 +23,7 @@ public sealed class ShuffleArtifactSystem : EntitySystem
var mobState = GetEntityQuery<MobStateComponent>();
List<EntityCoordinates> allCoords = new();
List<TransformComponent> toShuffle = new();
List<Entity<TransformComponent>> toShuffle = new();
foreach (var ent in _lookup.GetEntitiesInRange(uid, component.Radius, LookupFlags.Dynamic | LookupFlags.Sundries))
{
@@ -32,7 +32,7 @@ public sealed class ShuffleArtifactSystem : EntitySystem
var xform = Transform(ent);
toShuffle.Add(xform);
toShuffle.Add((ent, xform));
allCoords.Add(xform.Coordinates);
}