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,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)