From 567322fa8176204fb2a047bd765bbc859c5e9b8e Mon Sep 17 00:00:00 2001 From: Christopher Head Date: Sun, 22 Jul 2018 17:42:00 -0700 Subject: [PATCH] Let things fall behind movestones --- mesecons_movestones/init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua index 76fd3cd..f6a9f82 100644 --- a/mesecons_movestones/init.lua +++ b/mesecons_movestones/init.lua @@ -60,13 +60,17 @@ function mesecon.register_movestone(name, def, is_sticky, is_vertical) minetest.get_node_timer(frontpos):start(timer_interval) -- ### Step 3: If sticky, pull stack behind ### - if not is_sticky then - return + if is_sticky then + local backpos = vector.subtract(pos, direction) + success, stack, oldstack = mesecon.mvps_pull_all(backpos, direction, max_pull) + if success then + mesecon.mvps_move_objects(backpos, vector.multiply(direction, -1), oldstack, -1) + end end - local backpos = vector.subtract(pos, direction) - success, stack, oldstack = mesecon.mvps_pull_all(backpos, direction, max_pull) - if success then - mesecon.mvps_move_objects(backpos, vector.multiply(direction, -1), oldstack, -1) + + -- ### Step 4: Let things fall + if not is_vertical then + minetest.check_for_falling(vector.add(pos, {x=0, y=1, z=0})) end end