]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes Electrocutions to use available power, not consumed power (#24554)
authorVaren <ychwack@hotmail.it>
Thu, 1 Feb 2024 11:54:24 +0000 (12:54 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 11:54:24 +0000 (12:54 +0100)
-Electrocutions now happen using how much power there is rather than how much is being used.

Content.Server/Electrocution/ElectrocutionSystem.cs

index 11e56a65c4b18ba509e3823e377c79606f5b63be..aac500f34f8b4e704857106921b437bd0db0a3fb 100644 (file)
@@ -258,7 +258,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
             return false;
 
         var net = powerNet.NetworkNode;
-        var supp = net.LastCombinedSupply;
+        var supp = net.LastCombinedMaxSupply;
 
         if (supp <= 0f)
             return false;
@@ -295,7 +295,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
         {
             if (id != null &&
                 _nodeContainer.TryGetNode<Node>(nodeContainer, id, out var tryNode) &&
-                tryNode.NodeGroup is IBasePowerNet { NetworkNode: { LastCombinedSupply: > 0 } })
+                tryNode.NodeGroup is IBasePowerNet { NetworkNode: { LastCombinedMaxSupply: > 0 } })
             {
                 return tryNode;
             }