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,6 @@
using Content.Server.Power.Components;
using Content.Server.Station.Systems;
using Content.Shared.AlertLevel;
using Robust.Server.GameObjects;
namespace Content.Server.AlertLevel;
@@ -19,9 +18,10 @@ public sealed class AlertLevelDisplaySystem : EntitySystem
private void OnAlertChanged(AlertLevelChangedEvent args)
{
foreach (var (_, appearance) in EntityManager.EntityQuery<AlertLevelDisplayComponent, AppearanceComponent>())
var query = EntityQueryEnumerator<AlertLevelDisplayComponent, AppearanceComponent>();
while (query.MoveNext(out var uid, out _, out var appearance))
{
_appearance.SetData(appearance.Owner, AlertLevelDisplay.CurrentLevel, args.AlertLevel, appearance);
_appearance.SetData(uid, AlertLevelDisplay.CurrentLevel, args.AlertLevel, appearance);
}
}