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,4 +1,3 @@
using Content.Server.Morgue.Components;
using Content.Server.Storage.Components;
using Content.Shared.Body.Components;
using Content.Shared.Examine;
@@ -79,20 +78,21 @@ public sealed class MorgueSystem : EntitySystem
{
base.Update(frameTime);
foreach (var (comp, storage, appearance) in EntityQuery<MorgueComponent, EntityStorageComponent, AppearanceComponent>())
var query = EntityQueryEnumerator<MorgueComponent, EntityStorageComponent, AppearanceComponent>();
while (query.MoveNext(out var uid, out var comp, out var storage, out var appearance))
{
comp.AccumulatedFrameTime += frameTime;
CheckContents(comp.Owner, comp, storage);
CheckContents(uid, comp, storage);
if (comp.AccumulatedFrameTime < comp.BeepTime)
continue;
comp.AccumulatedFrameTime -= comp.BeepTime;
if (comp.DoSoulBeep && _appearance.TryGetData<MorgueContents>(appearance.Owner, MorgueVisuals.Contents, out var contents, appearance) && contents == MorgueContents.HasSoul)
if (comp.DoSoulBeep && _appearance.TryGetData<MorgueContents>(uid, MorgueVisuals.Contents, out var contents, appearance) && contents == MorgueContents.HasSoul)
{
_audio.PlayPvs(comp.OccupantHasSoulAlarmSound, comp.Owner);
_audio.PlayPvs(comp.OccupantHasSoulAlarmSound, uid);
}
}
}