diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-02-21 13:15:57 -0800 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-02-21 13:15:57 -0800 |
commit | 1a09ffaf499dc35a5a25a6006dc4fc70d8b7bf37 (patch) | |
tree | 49f7d2460b7992a46b6868f7e56b81c4a6fd4fbf | |
parent | 7904a3a1d3c615ac468796dc6706d4455381de01 (diff) | |
parent | 08acacba06a39d85e1bb9f16b7e7c9003ed6e6af (diff) |
Merge pull request #7 from khonkhortisan/master
Keep players from falling through moving frames
-rw-r--r-- | technic/frames.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/technic/frames.lua b/technic/frames.lua index efae0e5..0e095bd 100644 --- a/technic/frames.lua +++ b/technic/frames.lua @@ -364,7 +364,6 @@ function move_nodes_vect(poslist,vect) local node=minetest.env:get_node(pos) local meta=minetest.env:get_meta(pos):to_table() nodelist[#(nodelist)+1]={pos=pos,node=node,meta=meta} - minetest.env:remove_node(pos) end objects={} for _,pos in ipairs(poslist) do @@ -384,6 +383,15 @@ function move_nodes_vect(poslist,vect) minetest.env:set_node(npos,n.node) local meta=minetest.env:get_meta(npos) meta:from_table(n.meta) + for __,pos in ipairs(poslist) do + if npos.x==pos.x and npos.y==pos.y and npos.z==pos.z then + table.remove(poslist, __) + break + end + end + end + for __,pos in ipairs(poslist) do + minetest.env:remove_node(pos) end end |