Liquid Pumps: Fix issue with undetected pipe connection gaps

This commit is contained in:
Joachim Stolberg 2020-09-26 20:17:30 +02:00
parent 89d2e4b269
commit 916de1e3cc
6 changed files with 17 additions and 0 deletions

View File

@ -292,6 +292,7 @@ minetest.register_node("techage:ta4_doser", {
after_dig_node = function(pos, oldnode, oldmetadata, digger)
techage.remove_node(pos, oldnode, oldmetadata)
Pipe:after_dig_node(pos)
liquid.after_dig_pump(pos)
techage.del_mem(pos)
end,
on_receive_fields = on_receive_fields,

View File

@ -105,6 +105,8 @@ minetest.register_node("techage:ta4_liquid_filter_filler", {
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
Pipe:after_dig_node(pos)
liquid.after_dig_pump(pos)
techage.del_mem(pos)
end,
paramtype = "light",

View File

@ -117,6 +117,7 @@ minetest.register_node("techage:ta4_reactor_stand", {
after_dig_node = function(pos, oldnode)
Pipe:after_dig_node(pos)
Cable:after_dig_node(pos)
liquid.after_dig_pump(pos)
techage.del_mem(pos)
end,

View File

@ -235,3 +235,14 @@ function liquid.update_network(pos, outdir)
networks.node_connections(pos, Pipe)
delete_netID(pos, outdir)
end
-- To be called from each pump in 'after_dig_node'
-- before calling 'techage.del_mem(pos)'
function liquid.after_dig_pump(pos)
local nvm = techage.get_nvm(pos)
if nvm.pipe2 and nvm.pipe2.netIDs then
for outdir, netID in pairs(nvm.pipe2.netIDs) do
networks.delete_network("pipe2", netID)
end
end
end

View File

@ -135,6 +135,7 @@ end
local function after_dig_node(pos, oldnode, oldmetadata, digger)
Pipe:after_dig_node(pos)
liquid.after_dig_pump(pos)
techage.del_mem(pos)
end

View File

@ -126,6 +126,7 @@ end
local function after_dig_node(pos, oldnode, oldmetadata, digger)
Pipe:after_dig_node(pos)
Cable:after_dig_node(pos)
liquid.after_dig_pump(pos)
techage.del_mem(pos)
end