Don't take fully charged power storages into account while distributing power

This commit is contained in:
mrkubax10 2023-03-22 21:14:48 +01:00
parent 8da3968a46
commit b229fab831

View File

@ -196,7 +196,7 @@ industrialtest.api.powerFlow=function(pos)
local neighboursContainingPower=0
for key,value in ipairs(neighbours) do
local side=industrialtest.api.getOppositeSide(key)
if industrialtest.api.hasPowerStorage(value) and industrialtest.api.isPowerInput(value,side) then
if industrialtest.api.hasPowerStorage(value) and industrialtest.api.isPowerInput(value,side) and not industrialtest.api.isFullyCharged(value) then
neighboursContainingPower=neighboursContainingPower+1
else
neighbourPositions[key]=0