Fix power returning back from transformer to where it came from
This commit is contained in:
parent
25826e8e2b
commit
e64e3a1fcf
@ -1229,8 +1229,8 @@ local function registerTransformer(config)
|
|||||||
local lowerPowerDistribution=0
|
local lowerPowerDistribution=0
|
||||||
|
|
||||||
for key,value in ipairs(neighbourPositions) do
|
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
|
if normalized==5 then
|
||||||
upperPowerDistribution=config.upperFlow
|
upperPowerDistribution=config.upperFlow
|
||||||
else
|
else
|
||||||
@ -1262,9 +1262,12 @@ local function registerTransformer(config)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
meta:set_string("industrialtest.ioConfig","aaaaaa")
|
||||||
|
|
||||||
return (meta:get_int("industrialtest.powerAmount")>0 and roomAvailable)
|
return (meta:get_int("industrialtest.powerAmount")>0 and roomAvailable)
|
||||||
end,
|
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)
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user