mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 09:50:19 +01:00
Check for falling nodes on MVPS move (#371)
This commit is contained in:
parent
4f400f3fae
commit
1b10610f92
@ -205,12 +205,6 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti
|
|||||||
return true, nodes, oldstack
|
return true, nodes, oldstack
|
||||||
end
|
end
|
||||||
|
|
||||||
mesecon.register_on_mvps_move(function(moved_nodes)
|
|
||||||
for _, n in ipairs(moved_nodes) do
|
|
||||||
mesecon.on_placenode(n.pos, n.node)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function mesecon.mvps_move_objects(pos, dir, nodestack)
|
function mesecon.mvps_move_objects(pos, dir, nodestack)
|
||||||
local objects_to_move = {}
|
local objects_to_move = {}
|
||||||
local dir_k
|
local dir_k
|
||||||
@ -273,6 +267,11 @@ mesecon.register_on_mvps_move(mesecon.move_hot_nodes)
|
|||||||
mesecon.register_on_mvps_move(function(moved_nodes)
|
mesecon.register_on_mvps_move(function(moved_nodes)
|
||||||
for i = 1, #moved_nodes do
|
for i = 1, #moved_nodes do
|
||||||
local moved_node = moved_nodes[i]
|
local moved_node = moved_nodes[i]
|
||||||
|
mesecon.on_placenode(moved_node.pos, moved_node.node)
|
||||||
|
minetest.after(0, function()
|
||||||
|
minetest.check_for_falling(moved_node.oldpos)
|
||||||
|
minetest.check_for_falling(moved_node.pos)
|
||||||
|
end)
|
||||||
local node_def = minetest.registered_nodes[moved_node.node.name]
|
local node_def = minetest.registered_nodes[moved_node.node.name]
|
||||||
if node_def and node_def.mesecon and node_def.mesecon.on_mvps_move then
|
if node_def and node_def.mesecon and node_def.mesecon.on_mvps_move then
|
||||||
node_def.mesecon.on_mvps_move(moved_node.pos, moved_node.node,
|
node_def.mesecon.on_mvps_move(moved_node.pos, moved_node.node,
|
||||||
|
Loading…
Reference in New Issue
Block a user