Disabled PowerConsumers do not use Apc power (#2064)
Co-authored-by: py01 <pyronetics01@gmail.com>
This commit is contained in:
@@ -97,6 +97,9 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
var availablePowerFraction = totalCharge / totalMaxCharge;
|
||||
foreach (var receiver in _providerReceivers.SelectMany(kvp => kvp.Value))
|
||||
{
|
||||
if (!receiver.NeedsPower || receiver.PowerDisabled)
|
||||
continue;
|
||||
|
||||
receiver.HasApcPower = TryUsePower(receiver.Load * frameTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
public class PowerReceiverComponent : Component, IExamine
|
||||
{
|
||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override string Name => "PowerReceiver";
|
||||
|
||||
@@ -64,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
private int _load;
|
||||
|
||||
/// <summary>
|
||||
/// When true, causes this to appear powered even if not receiving power from an Apc.
|
||||
/// When false, causes this to appear powered even if not receiving power from an Apc.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool NeedsPower { get => _needsPower; set => SetNeedsPower(value); }
|
||||
@@ -73,6 +72,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
/// <summary>
|
||||
/// When true, causes this to never appear powered.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool PowerDisabled { get => _powerDisabled; set => SetPowerDisabled(value); }
|
||||
private bool _powerDisabled;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user