Bonk power allocations (#2392)

linq bad.

Last one on my hit list is PVS but that needs a full rewrite.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-10-26 20:31:41 +11:00
committed by GitHub
parent d460d2b64d
commit 71eea91f1b

View File

@@ -94,13 +94,16 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
totalCharge += battery.CurrentCharge;
totalMaxCharge += battery.MaxCharge;
}
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);
foreach (var (_, receivers) in _providerReceivers)
{
foreach (var receiver in receivers)
{
if (!receiver.NeedsPower || receiver.PowerDisabled)
continue;
receiver.HasApcPower = TryUsePower(receiver.Load * frameTime);
}
}
}