Fix bug 'TA2 boiler work without requiring boiler'

This commit is contained in:
Joachim Stolberg 2024-07-21 20:57:03 +02:00
parent ec982b0de0
commit 8f255ec545

View File

@ -41,10 +41,9 @@ end
local function after_place_node(pos) local function after_place_node(pos)
local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
if node.name == "techage:boiler1" then if node.name ~= "techage:boiler1" then
local nvm = techage.get_nvm(pos) minetest.remove_node(pos)
M(pos):set_string("formspec", boiler.formspec(pos, nvm)) return true
Pipe:after_place_node(pos)
end end
end end
@ -83,6 +82,9 @@ Pipe:add_secondary_node_names({"techage:boiler2"})
techage.register_node({"techage:boiler2"}, { techage.register_node({"techage:boiler2"}, {
on_transfer = function(pos, in_dir, topic, payload) on_transfer = function(pos, in_dir, topic, payload)
if topic == "trigger" then if topic == "trigger" then
if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "techage:boiler1" then
return 0
end
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
nvm.fire_trigger = true nvm.fire_trigger = true
if not minetest.get_node_timer(pos):is_started() then if not minetest.get_node_timer(pos):is_started() then