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

@@ -11,12 +11,14 @@ using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components;
using Content.Server.Temperature.Components;
using Content.Server.UserInterface;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Climbing.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.DoAfter;
@@ -30,8 +32,6 @@ using Content.Shared.Tools;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Timing;
using Content.Server.Temperature.Components;
using Content.Shared.Climbing.Systems;
namespace Content.Server.Medical;
@@ -83,18 +83,20 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
var itemSlotsQuery = GetEntityQuery<ItemSlotsComponent>();
var fitsInDispenserQuery = GetEntityQuery<FitsInDispenserComponent>();
var solutionContainerManagerQuery = GetEntityQuery<SolutionContainerManagerComponent>();
foreach (var (_, cryoPod) in EntityQuery<ActiveCryoPodComponent, CryoPodComponent>())
var query = EntityQueryEnumerator<ActiveCryoPodComponent, CryoPodComponent>();
while (query.MoveNext(out var uid, out _, out var cryoPod))
{
metaDataQuery.TryGetComponent(cryoPod.Owner, out var metaDataComponent);
if (curTime < cryoPod.NextInjectionTime + _metaDataSystem.GetPauseTime(cryoPod.Owner, metaDataComponent))
metaDataQuery.TryGetComponent(uid, out var metaDataComponent);
if (curTime < cryoPod.NextInjectionTime + _metaDataSystem.GetPauseTime(uid, metaDataComponent))
continue;
cryoPod.NextInjectionTime = curTime + TimeSpan.FromSeconds(cryoPod.BeakerTransferTime);
if (!itemSlotsQuery.TryGetComponent(cryoPod.Owner, out var itemSlotsComponent))
if (!itemSlotsQuery.TryGetComponent(uid, out var itemSlotsComponent))
{
continue;
}
var container = _itemSlotsSystem.GetItemOrNull(cryoPod.Owner, cryoPod.SolutionContainerName, itemSlotsComponent);
var container = _itemSlotsSystem.GetItemOrNull(uid, cryoPod.SolutionContainerName, itemSlotsComponent);
var patient = cryoPod.BodyContainer.ContainedEntity;
if (container != null
&& container.Value.Valid