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)
committersfan5 <sfan5@live.de>
Sun, 19 Nov 2017 22:03:38 +0000 (23:03 +0100)
mods/creative/init.lua

index 51d6f792e543bcc343248f521ac72b68a4714044..a33475dd98ebf5a9fd284cd7de6d78fe30515dcb 100644 (file)
@@ -46,10 +46,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()