summaryrefslogtreecommitdiff
path: root/mesecons_gates
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-11-30 20:20:01 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-11-30 20:34:55 -0500
commitf46bc329de7bfc35f64a17822247372e6fa3a1cb (patch)
tree6c2d44b6dfafbda51b8ea4a5cd5d1b91bfe6dfb5 /mesecons_gates
parent669e3d088030709a60db7e71e6503952fb997677 (diff)
downloadmesecons-f46bc329de7bfc35f64a17822247372e6fa3a1cb.tar
mesecons-f46bc329de7bfc35f64a17822247372e6fa3a1cb.tar.gz
mesecons-f46bc329de7bfc35f64a17822247372e6fa3a1cb.tar.bz2
mesecons-f46bc329de7bfc35f64a17822247372e6fa3a1cb.tar.xz
mesecons-f46bc329de7bfc35f64a17822247372e6fa3a1cb.zip
Use minetest.swap_node() instead of mesecons' version, Minor code changes
here and there to facilitate this.
Diffstat (limited to 'mesecons_gates')
-rw-r--r--mesecons_gates/init.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua
index 37b046f..de232f1 100644
--- a/mesecons_gates/init.lua
+++ b/mesecons_gates/init.lua
@@ -51,14 +51,15 @@ function set_gate(pos, on)
if yc_overheat(meta) then
pop_gate(pos)
else
+ local node = minetest.get_node(pos)
if on then
- mesecon:swap_node(pos, "mesecons_gates:"..gate.."_on")
+ minetest.swap_node(pos, {name = "mesecons_gates:"..gate.."_on", param2=node.param2})
mesecon:receptor_on(pos,
- gate_get_output_rules(minetest.env:get_node(pos)))
+ gate_get_output_rules(node))
else
- mesecon:swap_node(pos, "mesecons_gates:"..gate.."_off")
+ minetest.swap_node(pos, {name = "mesecons_gates:"..gate.."_off", param2=node.param2})
mesecon:receptor_off(pos,
- gate_get_output_rules(minetest.env:get_node(pos)))
+ gate_get_output_rules(node))
end
end
end