diff options
Diffstat (limited to 'mesecons_pistons')
-rw-r--r-- | mesecons_pistons/init.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index e9f7b5b..be0077d 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -101,10 +101,12 @@ local function piston_off(pos, node) if not pistonspec.sticky then return end - local dir = vector.multiply(minetest.facedir_to_dir(node.param2), -1) - local pullpos = vector.add(pos, vector.multiply(dir, 2)) - local stack = mesecon.mvps_pull_single(pullpos, vector.multiply(dir, -1), max_pull) - mesecon.mvps_process_stack(pos, dir, stack) + local dir = minetest.facedir_to_dir(node.param2) + local pullpos = vector.add(pos, vector.multiply(dir, -2)) + local success, stack, oldstack = mesecon.mvps_pull_single(pullpos, dir, max_pull) + if success then + mesecon.mvps_move_objects(pullpos, vector.multiply(dir, -1), oldstack, -1) + end end local orientations = { |