From aaddd9e74dbcae2211bd44bf544de08c69bce8e2 Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Tue, 27 Nov 2012 19:34:54 -0500 Subject: [PATCH] Fix a rare piston pushing bug and make piston updating faster. --- mesecons_pistons/init.lua | 7 +++---- mesecons_pistons/pistons_down.lua | 5 ++--- mesecons_pistons/pistons_up.lua | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index e6d09de..7dbace8 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -134,7 +134,7 @@ local update = function(pos, node) local timer = minetest.env:get_node_timer(pos) timer:stop() - timer:set(0.1, 0) + timer:start(0) end mesecon:register_on_signal_on(update) --push action mesecon:register_on_signal_off(update) --pull action @@ -150,14 +150,13 @@ function mesecon:piston_push(pos) while true do local checknode = minetest.env:get_node(checkpos) - --check for collision with stopper - if mesecon:is_mvps_stopper(checknode.name) then + --check for collision with stopper or bounds + if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then return end --check for column end if checknode.name == "air" - or checknode.name == "ignore" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then break end diff --git a/mesecons_pistons/pistons_down.lua b/mesecons_pistons/pistons_down.lua index 701f247..fb16c6f 100644 --- a/mesecons_pistons/pistons_down.lua +++ b/mesecons_pistons/pistons_down.lua @@ -133,14 +133,13 @@ mesecon:register_on_signal_on(function(pos, node) while true do local checknode = minetest.env:get_node(checkpos) - --check for collision with stopper - if mesecon:is_mvps_stopper(checknode.name) then + --check for collision with stopper or bounds + if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then return end --check for column end if checknode.name == "air" - or checknode.name == "ignore" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then break end diff --git a/mesecons_pistons/pistons_up.lua b/mesecons_pistons/pistons_up.lua index d04bdee..cbee277 100644 --- a/mesecons_pistons/pistons_up.lua +++ b/mesecons_pistons/pistons_up.lua @@ -121,14 +121,13 @@ mesecon:register_on_signal_on(function(pos, node) while true do local checknode = minetest.env:get_node(checkpos) - --check for collision with stopper - if mesecon:is_mvps_stopper(checknode.name) then + --check for collision with stopper or bounds + if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then return end --check for column end if checknode.name == "air" - or checknode.name == "ignore" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then break end