summaryrefslogtreecommitdiff
path: root/mesecons_movestones
diff options
context:
space:
mode:
authorChristopher Head <chead@chead.ca>2018-07-23 03:14:05 -0700
committerVitaliy <silverunicorn2011@yandex.ru>2018-07-23 13:14:05 +0300
commitf61b1affea744e2bb131b2e01bbc47b3a36b99f2 (patch)
treed952fbccca44c6779826154dcc17c9b12c679b83 /mesecons_movestones
parenta2340065925a2b622bba45661b8a5f96a888101a (diff)
downloadmesecons-f61b1affea744e2bb131b2e01bbc47b3a36b99f2.tar
mesecons-f61b1affea744e2bb131b2e01bbc47b3a36b99f2.tar.gz
mesecons-f61b1affea744e2bb131b2e01bbc47b3a36b99f2.tar.bz2
mesecons-f61b1affea744e2bb131b2e01bbc47b3a36b99f2.tar.xz
mesecons-f61b1affea744e2bb131b2e01bbc47b3a36b99f2.zip
Let things fall behind movestones (#421)
* Let things fall behind movestones
Diffstat (limited to 'mesecons_movestones')
-rw-r--r--mesecons_movestones/init.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index 76fd3cd..7a2f7e8 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -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