Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-20 15:31:13 +02:00
committed by Debug
parent 1561629bc2
commit 9cc8a7fc81
261 changed files with 2291 additions and 2036 deletions
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Power.EntitySystems;
using Content.Shared.Research.Components;
using Robust.Server.Player;
@@ -58,9 +57,15 @@ public sealed partial class ResearchSystem
private void OnClientMapInit(EntityUid uid, ResearchClientComponent component, MapInitEvent args)
{
var allServers = EntityQuery<ResearchServerComponent>(true).ToArray();
if (allServers.Length > 0)
RegisterClient(uid, allServers[0].Owner, component, allServers[0]);
var allServers = new List<Entity<ResearchServerComponent>>();
var query = AllEntityQuery<ResearchServerComponent>();
while (query.MoveNext(out var serverUid, out var serverComp))
{
allServers.Add((serverUid, serverComp));
}
if (allServers.Count > 0)
RegisterClient(uid, allServers[0], component, allServers[0]);
}
private void OnClientShutdown(EntityUid uid, ResearchClientComponent component, ComponentShutdown args)