Builtin: Fix error by digging unknown nodes
authorSmallJoker <mk939@ymail.com>
Sun, 16 Feb 2020 13:01:05 +0000 (14:01 +0100)
committerSmallJoker <mk939@ymail.com>
Sun, 16 Feb 2020 13:13:52 +0000 (14:13 +0100)
builtin/game/item.lua

index cc221b3f5e7fbf859e335cfdc47f3350d8cd6a11..513c3a5e194f2296de98d7d9d5ef725e162bf350 100644 (file)
@@ -621,7 +621,7 @@ function core.node_dig(pos, node, digger)
        core.remove_node(pos)
 
        -- Play sound if it was done by a player
-       if diggername ~= "" and def.sounds and def.sounds.dug then
+       if diggername ~= "" and def and def.sounds and def.sounds.dug then
                core.sound_play(def.sounds.dug, {
                        pos = pos,
                        exclude_player = diggername,