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_pistons/init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesecons_pistons/init.lua') 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 -- cgit v1.2.3