Skip to content

Commit

Permalink
Creative: Make handle_node_drops override work for non-player diggers
Browse files Browse the repository at this point in the history
  • Loading branch information
raymoo authored and paramat committed Nov 11, 2017
1 parent d4e1bd0 commit 319b9ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mods/creative/init.lua
Expand Up @@ -53,10 +53,8 @@ end)
-- 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)
if not digger or not digger:is_player() then
return
end
if not creative.is_enabled_for(digger:get_player_name()) then
if not digger or not digger:is_player() or
not creative.is_enabled_for(digger:get_player_name()) then
return old_handle_node_drops(pos, drops, digger)
end
local inv = digger:get_inventory()
Expand Down

0 comments on commit 319b9ee

Please sign in to comment.