Make sure to properly distribute available power across all endpoints

This commit is contained in:
mrkubax10 2025-03-10 11:55:48 +01:00
parent 4698266b33
commit 70dacf9a8c

View File

@ -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