Creative: Make handle_node_drops override work for non-player diggers
authorraymoo <raymoo@users.noreply.github.com>
Mon, 2 Oct 2017 01:20:50 +0000 (18:20 -0700)
committerparamat <mat.gregory@virginmedia.com>
Sat, 11 Nov 2017 21:34:05 +0000 (21:34 +0000)
mods/creative/init.lua

index 9295c8a6b994828c8894ff0da5b38d64f14281ca..09dc2dc7da13b89bc695b57fadf841b2d149ba94 100644 (file)
@@ -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()