Skip to content

Commit

Permalink
Let things fall behind movestones (#421)
Browse files Browse the repository at this point in the history
* Let things fall behind movestones
  • Loading branch information
Hawk777 authored and numberZero committed Jul 23, 2018
1 parent a234006 commit f61b1af
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mesecons_movestones/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ 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
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)
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

-- ### Step 4: Let things fall ###
minetest.check_for_falling(vector.add(pos, {x=0, y=1, z=0}))
end

def.is_ground_content = false
Expand Down

0 comments on commit f61b1af

Please sign in to comment.