summaryrefslogtreecommitdiff
path: root/mesecons_pistons
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons_pistons')
-rw-r--r--mesecons_pistons/init.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index 7780fc9..efc18f3 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -56,14 +56,15 @@ end
local piston_remove_pusher = function(pos, node)
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
- if pushername == pistonspec.pusher then --make sure there actually is a pusher (for compatibility reasons mainly)
- return
- end
-
dir = piston_get_direction(pistonspec.dir, node)
local pusherpos = mesecon:addPosRule(pos, dir)
local pushername = minetest.get_node(pusherpos).name
+ -- make sure there actually is a pusher (for compatibility reasons mainly)
+ if pushername ~= pistonspec.pusher then
+ return
+ end
+
minetest.remove_node(pusherpos)
minetest.sound_play("piston_retract", {
pos = pos,