MVPS: pull objects (#374)

This commit is contained in:
DS
2017-10-18 21:53:22 +02:00
committed by Vitaliy
parent 1b10610f92
commit 748446b3cc
3 changed files with 17 additions and 10 deletions

View File

@ -50,7 +50,6 @@ function mesecon.register_movestone(name, def, is_sticky, is_vertical)
minetest.get_node_timer(pos):start(timer_interval)
return
end
mesecon.mvps_process_stack(stack)
mesecon.mvps_move_objects(frontpos, direction, oldstack)
-- ### Step 2: Move the movestone ###
@ -61,9 +60,13 @@ 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 is_sticky then
local backpos = vector.subtract(pos, direction)
mesecon.mvps_pull_all(backpos, direction, max_pull)
if not is_sticky then
return
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)
end
end