diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2012-12-27 13:51:36 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2012-12-27 13:51:36 -0500 |
commit | 2a061362fbe5f4069377e20e5425deb49782b334 (patch) | |
tree | 7769edcb1ad9eee66d2449f1da009682b6f1bacc | |
parent | 92122379de3b92d66942e1dbe8900c0708e4b45c (diff) | |
parent | c63afd49ecd40cb9865b455c7f75cb47c6f4672f (diff) | |
download | mesecons-2a061362fbe5f4069377e20e5425deb49782b334.tar mesecons-2a061362fbe5f4069377e20e5425deb49782b334.tar.gz mesecons-2a061362fbe5f4069377e20e5425deb49782b334.tar.bz2 mesecons-2a061362fbe5f4069377e20e5425deb49782b334.tar.xz mesecons-2a061362fbe5f4069377e20e5425deb49782b334.zip |
Merge branch 'nextgen' of github.com:Jeija/minetest-mod-mesecons into nextgen
-rw-r--r-- | mesecons_pistons/init.lua | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index ab04026..576c03a 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -643,13 +643,18 @@ local piston_up_down_get_stopper = function (node, dir, stack, stackid) end local piston_get_stopper = function (node, dir, stack, stackid) - if (stack[stackid + 1] - and stack[stackid + 1].node.name == minetest.registered_nodes[node.name].mesecons_piston.pusher - and stack[stackid + 1].node.param2 == node.param2) - or (stack[stackid - 1] - and stack[stackid - 1].node.name == minetest.registered_nodes[node.name].mesecons_piston.pusher - and stack[stackid + 1].node.param2 == node.param2) then - return false + pistonspec = minetest.registered_nodes[node.name].mesecons_piston + dir = piston_get_direction(pistonspec.dir, node) + local pusherpos = mesecon:addPosRule(stack[stackid].pos, dir) + local pushernode = minetest.env:get_node(pusherpos) + + if minetest.registered_nodes[node.name].mesecons_piston.pusher == pushernode.name then + for _, s in ipairs(stack) do + if mesecon:cmpPos(s.pos, pusherpos) -- pusher is also to be pushed + and s.node.param2 == node.param2 then + return false + end + end end return true end @@ -657,11 +662,11 @@ end mesecon:register_mvps_stopper("mesecons_pistons:piston_normal_on", piston_get_stopper) mesecon:register_mvps_stopper("mesecons_pistons:piston_sticky_on", piston_pusher_get_stopper) -mesecon:register_mvps_stopper("mesecons_pistons:piston_normal_on", piston_up_down_get_stopper) -mesecon:register_mvps_stopper("mesecons_pistons:piston_sticky_on", piston_up_down_get_stopper) +mesecon:register_mvps_stopper("mesecons_pistons:piston_up_normal_on", piston_up_down_get_stopper) +mesecon:register_mvps_stopper("mesecons_pistons:piston_up_sticky_on", piston_up_down_get_stopper) -mesecon:register_mvps_stopper("mesecons_pistons:piston_normal_on", piston_up_down_get_stopper) -mesecon:register_mvps_stopper("mesecons_pistons:piston_sticky_on", piston_up_down_get_stopper) +mesecon:register_mvps_stopper("mesecons_pistons:piston_down_normal_on", piston_up_down_get_stopper) +mesecon:register_mvps_stopper("mesecons_pistons:piston_down_sticky_on", piston_up_down_get_stopper) --craft recipes minetest.register_craft({ |