forked from mrkubax10/industrialtest
Don't take fully charged power storages into account while distributing power
This commit is contained in:
parent
8da3968a46
commit
b229fab831
2
api.lua
2
api.lua
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user