diff options
author | DS <vorunbekannt75@web.de> | 2017-10-18 21:53:22 +0200 |
---|---|---|
committer | Vitaliy <silverunicorn2011@yandex.ru> | 2017-10-18 22:53:22 +0300 |
commit | 748446b3cc4d663764e632c9de62eff2e530b44c (patch) | |
tree | bd92de0b0e0ffa517def4fdd4d4102d358e8cf60 /mesecons_pistons | |
parent | 1b10610f9221f2df1afb0dba18a88c1ac324ab60 (diff) |
MVPS: pull objects (#374)
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 = { |