Fix node drops not being added to inventory when not in creative mode

This commit is contained in:
rubenwardy 2017-01-27 19:48:27 +00:00
parent 1dd9fdb530
commit b06368adf2

@ -42,11 +42,14 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
end) end)
-- Don't pick up if the item is already in the inventory -- Don't pick up if the item is already in the inventory
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger) function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() or if not digger or not digger:is_player() then
not creative.is_enabled_for(digger:get_player_name()) then
return return
end end
if not creative.is_enabled_for(digger:get_player_name()) then
return old_handle_node_drops(pos, drops, digger)
end
local inv = digger:get_inventory() local inv = digger:get_inventory()
if inv then if inv then
for _, item in ipairs(drops) do for _, item in ipairs(drops) do