Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -30,11 +30,10 @@ public sealed class ArtifactGasTriggerSystem : EntitySystem
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
List<ArtifactComponent> toUpdate = new();
|
||||
foreach (var (trigger, artifact, transform) in EntityQuery<ArtifactGasTriggerComponent, ArtifactComponent, TransformComponent>())
|
||||
List<Entity<ArtifactComponent>> toUpdate = new();
|
||||
var query = EntityQueryEnumerator<ArtifactGasTriggerComponent, ArtifactComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var uid, out var trigger, out var artifact, out var transform))
|
||||
{
|
||||
var uid = trigger.Owner;
|
||||
|
||||
if (trigger.ActivationGas == null)
|
||||
continue;
|
||||
|
||||
@@ -49,12 +48,12 @@ public sealed class ArtifactGasTriggerSystem : EntitySystem
|
||||
if (moles < trigger.ActivationMoles)
|
||||
continue;
|
||||
|
||||
toUpdate.Add(artifact);
|
||||
toUpdate.Add((uid, artifact));
|
||||
}
|
||||
|
||||
foreach (var a in toUpdate)
|
||||
{
|
||||
_artifactSystem.TryActivateArtifact(a.Owner, null, a);
|
||||
_artifactSystem.TryActivateArtifact(a, null, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user