From b229fab831a4ab8691a9796524c6ce7ee8f0dd87 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Wed, 22 Mar 2023 21:14:48 +0100 Subject: [PATCH] Don't take fully charged power storages into account while distributing power --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 8422bfa..91471d1 100644 --- a/api.lua +++ b/api.lua @@ -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