From c326dc221a4ee6a1b55b681eb1456d7da62de7fb Mon Sep 17 00:00:00 2001 From: Jeija Date: Sat, 29 Nov 2014 15:08:37 +0100 Subject: Rewrite Logic Gates: Makes it super-easy to add new gates and cleans up code Fix bugs in the Luacontroller (when placing, false input pin values were given) and fix variables leaking into the global environment in pistons. --- mesecons_mvps/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesecons_mvps') diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 163ad28..bcbda17 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -94,7 +94,7 @@ function mesecon.mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: directio -- add nodes for _, n in ipairs(nodes) do - np = mesecon.addPosRule(n.pos, dir) + local np = mesecon.addPosRule(n.pos, dir) minetest.add_node(np, n.node) minetest.get_meta(np):from_table(n.meta) end @@ -123,8 +123,8 @@ mesecon.register_on_mvps_move(function(moved_nodes) end) function mesecon.mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: direction of pull (matches push direction for sticky pistons) - np = mesecon.addPosRule(pos, dir) - nn = minetest.get_node(np) + local np = mesecon.addPosRule(pos, dir) + local nn = minetest.get_node(np) if ((not minetest.registered_nodes[nn.name]) --unregistered node or minetest.registered_nodes[nn.name].liquidtype == "none") --non-liquid node -- cgit v1.2.3