diff options
author | Jeija <norrepli@gmail.com> | 2013-04-02 11:56:37 +0200 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2013-04-02 11:57:28 +0200 |
commit | 57e15475151032322329391dfca252a625b82ae3 (patch) | |
tree | 6b65ea5dd6f7c238a339800d73a334fa254e19f8 /mesecons_pistons | |
parent | 2cc38909a12ad2ea9a62eac35eb66bcecd721b9f (diff) |
Make pistons and movestones move objects (push only yet)
Diffstat (limited to 'mesecons_pistons')
-rw-r--r-- | mesecons_pistons/init.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 701c95a..caadddf 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -70,13 +70,14 @@ end local piston_on = function (pos, node) local pistonspec = minetest.registered_nodes[node.name].mesecons_piston - dir = piston_get_direction(pistonspec.dir, node) + local dir = piston_get_direction(pistonspec.dir, node) local np = mesecon:addPosRule(pos, dir) - success, stack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH) + local success, stack, oldstack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH) if success then minetest.env:add_node(pos, {param2 = node.param2, name = pistonspec.onname}) - minetest.env:add_node(np, {param2 = node.param2, name = pistonspec.pusher}) - mesecon:mvps_process_stack(stack) + minetest.env:add_node(np, {param2 = node.param2, name = pistonspec.pusher}) + mesecon:mvps_process_stack (stack) + mesecon:mvps_move_objects (np, dir, oldstack) end end @@ -89,7 +90,7 @@ local piston_off = function (pos, node) dir = piston_get_direction(pistonspec.dir, node) pullpos = mesecon:addPosRule(pos, dir) stack = mesecon:mvps_pull_single(pullpos, dir) - mesecon:mvps_process_stack(stack) + mesecon:mvps_process_stack(pos, dir, stack) end end |