Fixes Electrocutions to use available power, not consumed power (#24554)
-Electrocutions now happen using how much power there is rather than how much is being used.
This commit is contained in:
@@ -258,7 +258,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var net = powerNet.NetworkNode;
|
var net = powerNet.NetworkNode;
|
||||||
var supp = net.LastCombinedSupply;
|
var supp = net.LastCombinedMaxSupply;
|
||||||
|
|
||||||
if (supp <= 0f)
|
if (supp <= 0f)
|
||||||
return false;
|
return false;
|
||||||
@@ -295,7 +295,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
|
|||||||
{
|
{
|
||||||
if (id != null &&
|
if (id != null &&
|
||||||
_nodeContainer.TryGetNode<Node>(nodeContainer, id, out var tryNode) &&
|
_nodeContainer.TryGetNode<Node>(nodeContainer, id, out var tryNode) &&
|
||||||
tryNode.NodeGroup is IBasePowerNet { NetworkNode: { LastCombinedSupply: > 0 } })
|
tryNode.NodeGroup is IBasePowerNet { NetworkNode: { LastCombinedMaxSupply: > 0 } })
|
||||||
{
|
{
|
||||||
return tryNode;
|
return tryNode;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user