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
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ industrialtest.api.powerFlow=function(pos)
local neighboursContainingPower=0 local neighboursContainingPower=0
for key,value in ipairs(neighbours) do for key,value in ipairs(neighbours) do
local side=industrialtest.api.getOppositeSide(key) 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 neighboursContainingPower=neighboursContainingPower+1
else else
neighbourPositions[key]=0 neighbourPositions[key]=0