Fix power returning back from transformer to where it came from

This commit is contained in:
mrkubax10 2023-03-29 10:15:19 +02:00
parent 25826e8e2b
commit e64e3a1fcf

View File

@ -1229,8 +1229,8 @@ local function registerTransformer(config)
local lowerPowerDistribution=0
for key,value in ipairs(neighbourPositions) do
if industrialtest.api.hasPowerStorage(minetest.get_meta(value)) then
local normalized=industrialtest.api.normalizeSide(pos,key)
local normalized=industrialtest.api.normalizeSide(pos,key)
if industrialtest.api.hasPowerStorage(minetest.get_meta(value)) and industrialtest.api.isPowerOutput(meta,normalized) then
if normalized==5 then
upperPowerDistribution=config.upperFlow
else
@ -1262,9 +1262,12 @@ local function registerTransformer(config)
end
end
meta:set_string("industrialtest.ioConfig","aaaaaa")
return (meta:get_int("industrialtest.powerAmount")>0 and roomAvailable)
end,
_industrialtest_onPowerFlow=function(pos)
_industrialtest_onPowerFlow=function(pos,side)
industrialtest.api.changeIoConfig(minetest.get_meta(pos),industrialtest.api.normalizeSide(pos,side),"i")
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
end
}