1
0
Fork 0

Pistons: When pushing a dropper node, dig it

Instead of calling handle_node_drops, etc.
This commit is contained in:
Bu-Gee 2018-03-13 02:45:18 +01:00 committed by Wuzzy
parent e19271398d
commit d2f01c68f5
1 changed files with 6 additions and 3 deletions

View File

@ -218,10 +218,10 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti
local is_dropper = mesecon.is_mvps_dropper(n.node, movedir, nodes, id) local is_dropper = mesecon.is_mvps_dropper(n.node, movedir, nodes, id)
if is_dropper then if is_dropper then
local drops = minetest.get_node_drops(n.node.name, "") local drops = minetest.get_node_drops(n.node.name, "")
local droppos = vector.add(n.pos, movedir) minetest.dig_node(n.pos)
minetest.handle_node_drops(droppos, drops, nil) else
minetest.remove_node(n.pos)
end end
minetest.remove_node(n.pos)
if is_dropper then if is_dropper then
first_dropper = id first_dropper = id
break break
@ -256,6 +256,9 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti
local moved_nodes = {} local moved_nodes = {}
local oldstack = mesecon.tablecopy(nodes) local oldstack = mesecon.tablecopy(nodes)
for i in ipairs(nodes) do for i in ipairs(nodes) do
if first_dropper and i >= first_dropper then
break
end
moved_nodes[i] = {} moved_nodes[i] = {}
moved_nodes[i].oldpos = nodes[i].pos moved_nodes[i].oldpos = nodes[i].pos
nodes[i].pos = vector.add(nodes[i].pos, movedir) nodes[i].pos = vector.add(nodes[i].pos, movedir)