Merge branch '6-move_item_crash' into 'master'

fix(bug):fix for a rare crash due to on_dig callback by non-player.

Closes #6

See merge request VanessaE/unifieddyes!6
This commit is contained in:
Vanessa Dannenberg 2020-07-09 16:19:35 +00:00
commit c91c68e0f5
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ minetest.register_on_placenode(
-- The complementary function: strip-off the color if the node being dug is still white/neutral
local function move_item(item, pos, inv, digger)
if not digger then return end
if not (digger and digger:is_player()) then return end
local creative = creative_mode or minetest.check_player_privs(digger, "creative")
if inv:room_for_item("main", item)
and (not creative or not inv:contains_item("main", item, true)) then