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_pistons/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_pistons/init.lua')
-rw-r--r-- | mesecons_pistons/init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index b247039..71e63e7 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -55,8 +55,8 @@ piston_get_direction = function(dir, node) end local piston_remove_pusher = function(pos, node) - pistonspec = minetest.registered_nodes[node.name].mesecons_piston - dir = piston_get_direction(pistonspec.dir, node) + local pistonspec = minetest.registered_nodes[node.name].mesecons_piston + local dir = piston_get_direction(pistonspec.dir, node) local pusherpos = mesecon.addPosRule(pos, dir) local pushername = minetest.get_node(pusherpos).name @@ -100,9 +100,9 @@ local piston_off = function(pos, node) piston_remove_pusher(pos, node) if pistonspec.sticky then - dir = piston_get_direction(pistonspec.dir, node) - pullpos = mesecon.addPosRule(pos, dir) - stack = mesecon.mvps_pull_single(pullpos, dir) + local dir = piston_get_direction(pistonspec.dir, node) + local pullpos = mesecon.addPosRule(pos, dir) + local stack = mesecon.mvps_pull_single(pullpos, dir) mesecon.mvps_process_stack(pos, dir, stack) end end |