Fix some issues with power flowing

This commit is contained in:
2023-11-21 20:28:09 +01:00
parent f3d05ac5bb
commit 68ddf0f149
4 changed files with 7 additions and 11 deletions

View File

@@ -241,7 +241,6 @@ reactor.activeOnTimer=function(pos,elapsed,meta,inv)
inv:set_stack("fuel",coolant,coolantStack)
end
if heat>200 then
-- TODO: Explode
minetest.remove_node(pos)
industrialtest.internal.explode(pos,#maxCluster*4)
return false,false

View File

@@ -32,20 +32,16 @@ transformer.onTimer=function(pos,elapsed,meta)
local afterFlowLower=false
local afterFlowUpper=false
if powerAmount>=def._industrialtest_lowerFlow then
meta:set_int("industrialtest.powerFlow",def._industrialtest_lowerFlow)
afterFlowLower,_=industrialtest.api.powerFlow(pos,{
[1]=true,
[2]=true,
[3]=true,
[4]=true,
[6]=true
})
meta:set_int("industrialtest.powerFlow",industrialtest.api.ivPowerFlow)
},def._industrialtest_lowerFlow)
end
if powerAmount>=def._industrialtest_upperFlow then
meta:set_int("industrialtest.powerFlow",def._industrialtest_upperFlow)
afterFlowUpper,_=industrialtest.api.powerFlow(pos,{[5]=true})
meta:set_int("industrialtest.powerFlow",industrialtest.api.ivPowerFlow)
afterFlowUpper,_=industrialtest.api.powerFlow(pos,{[5]=true},def._industrialtest_upperFlow)
end
return powerAmount>0 and (afterFlowLower or afterFlowUpper),false
end