diff options
author | Jeija <jeija@mesecons.net> | 2014-11-29 15:08:37 +0100 |
---|---|---|
committer | Jeija <jeija@mesecons.net> | 2014-11-29 15:08:37 +0100 |
commit | c326dc221a4ee6a1b55b681eb1456d7da62de7fb (patch) | |
tree | 60769bae80240ae8cf6947b48ea5eb5b5947ca9a /mesecons_mvps/init.lua | |
parent | d2373eb6059fabc2e5116fb8a50ebc02e351d24d (diff) |
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.
Diffstat (limited to 'mesecons_mvps/init.lua')
-rw-r--r-- | mesecons_mvps/init.lua | 6 |
1 files changed, 3 insertions, 3 deletions
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 |