From 70dacf9a8c4015ae262c45f3b9da3947b2d0e62c Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Mon, 10 Mar 2025 11:55:48 +0100 Subject: [PATCH] Make sure to properly distribute available power across all endpoints --- api/network.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/network.lua b/api/network.lua index 922eacd..7ef8b8d 100644 --- a/api/network.lua +++ b/api/network.lua @@ -64,7 +64,7 @@ function industrialtest.api.powerFlow(pos,sides,flowOverride) if endpointCount==0 then return false,false end - local powerDistribution=math.floor((flowOverride and flowOverride or meta:get_int("industrialtest.powerFlow"))/endpointCount) + local powerDistribution=math.floor((flowOverride and flowOverride or math.min(meta:get_int("industrialtest.powerAmount"),meta:get_int("industrialtest.powerFlow")))/endpointCount) local transferred=false local roomAvailable=false for _,endpoint in ipairs(network) do