Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
using System.Threading;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.StationEvents.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Threading;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Timer = Robust.Shared.Timing.Timer;
|
||||
using System.Linq;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Robust.Shared.Random;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.StationEvents.Components;
|
||||
|
||||
namespace Content.Server.StationEvents.Events
|
||||
{
|
||||
@@ -26,10 +24,11 @@ namespace Content.Server.StationEvents.Events
|
||||
if (!TryGetRandomStation(out var chosenStation))
|
||||
return;
|
||||
|
||||
foreach (var (apc, transform) in EntityQuery<ApcComponent, TransformComponent>(true))
|
||||
var query = AllEntityQuery<ApcComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var apcUid ,out var apc, out var transform))
|
||||
{
|
||||
if (apc.MainBreakerEnabled && CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == chosenStation)
|
||||
component.Powered.Add(apc.Owner);
|
||||
component.Powered.Add(apcUid);
|
||||
}
|
||||
|
||||
RobustRandom.Shuffle(component.Powered);
|
||||
|
||||
Reference in New Issue
Block a user