fix nodebreaker not ejecting replacement items

fixes #137
This commit is contained in:
OgelGames 2024-09-05 12:56:33 +10:00
parent 63bc754889
commit a2ffaa9dc3

@ -251,7 +251,8 @@ if pipeworks.enable_node_breaker then
local old_stack = ItemStack(stack) local old_stack = ItemStack(stack)
local item_def = minetest.registered_items[stack:get_name()] local item_def = minetest.registered_items[stack:get_name()]
if item_def.on_use then if item_def.on_use then
fakeplayer:set_wielded_item(item_def.on_use(stack, fakeplayer, pointed) or stack) stack = item_def.on_use(stack, fakeplayer, pointed) or stack
fakeplayer:set_wielded_item(stack)
else else
local node = minetest.get_node(pointed.under) local node = minetest.get_node(pointed.under)
local node_def = minetest.registered_nodes[node.name] local node_def = minetest.registered_nodes[node.name]