Skip to content

Commit

Permalink
Update PowerNetSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fansana authored Dec 14, 2024
1 parent 56293da commit 44b9192
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Content.Server/Power/EntitySystems/PowerNetSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
using Content.Server.Power.Components;
using Content.Server.Power.NodeGroups;
using Content.Server.Power.Pow3r;
using Content.Shared.CCVar;
using Content.Shared.Power;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Threading;

namespace Content.Server.Power.EntitySystems
Expand All @@ -20,21 +18,19 @@ public sealed class PowerNetSystem : EntitySystem
{
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly PowerNetConnectorSystem _powerNetConnector = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IParallelManager _parMan = default!;

private readonly PowerState _powerState = new();
private readonly HashSet<PowerNet> _powerNetReconnectQueue = new();
private readonly HashSet<ApcNet> _apcNetReconnectQueue = new();

private BatteryRampPegSolver _solver = new();

private readonly BatteryRampPegSolver _solver = new();
public override void Initialize()
{
base.Initialize();

UpdatesAfter.Add(typeof(NodeGroupSystem));
_solver = new(_cfg.GetCVar(CCVars.DebugPow3rDisableParallel));

SubscribeLocalEvent<ApcPowerReceiverComponent, ComponentInit>(ApcPowerReceiverInit);
SubscribeLocalEvent<ApcPowerReceiverComponent, ComponentShutdown>(ApcPowerReceiverShutdown);
Expand All @@ -57,12 +53,6 @@ public override void Initialize()
SubscribeLocalEvent<PowerSupplierComponent, EntityPausedEvent>(PowerSupplierPaused);
SubscribeLocalEvent<PowerSupplierComponent, EntityUnpausedEvent>(PowerSupplierUnpaused);

Subs.CVar(_cfg, CCVars.DebugPow3rDisableParallel, DebugPow3rDisableParallelChanged);
}

private void DebugPow3rDisableParallelChanged(bool val)
{
_solver = new(val);
}

private void ApcPowerReceiverInit(EntityUid uid, ApcPowerReceiverComponent component, ComponentInit args)
Expand Down

0 comments on commit 44b9192

Please sign in to comment.