Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user