diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-11-30 20:20:01 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-11-30 20:34:55 -0500 |
commit | f46bc329de7bfc35f64a17822247372e6fa3a1cb (patch) | |
tree | 6c2d44b6dfafbda51b8ea4a5cd5d1b91bfe6dfb5 /mesecons_button/init.lua | |
parent | 669e3d088030709a60db7e71e6503952fb997677 (diff) |
Use minetest.swap_node() instead of mesecons' version, Minor code changes
here and there to facilitate this.
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) |