diff options
Diffstat (limited to 'mesecons_button/init.lua')
-rw-r--r-- | mesecons_button/init.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua index 5480fb0..beca63e 100644 --- a/mesecons_button/init.lua +++ b/mesecons_button/init.lua @@ -5,7 +5,7 @@ mesecon.button_turnoff = function (pos) local node = minetest.env:get_node(pos) if node.name=="mesecons_button:button_on" then --has not been dug - mesecon:swap_node(pos, "mesecons_button:button_off") + minetest.swap_node(pos, {name = "mesecons_button:button_off", param2=node.param2}) minetest.sound_play("mesecons_button_pop", {pos=pos}) local rules = mesecon.rules.buttonlike_get(node) mesecon:receptor_off(pos, rules) @@ -41,7 +41,7 @@ minetest.register_node("mesecons_button:button_off", { groups = {dig_immediate=2, mesecon_needs_receiver = 1}, description = "Button", on_punch = function (pos, node) - mesecon:swap_node(pos, "mesecons_button:button_on") + minetest.swap_node(pos, {name = "mesecons_button:button_on", param2=node.param2}) mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.after(1, mesecon.button_turnoff, pos) |