Fix crash when digging nodes with hoe

Previously the game would crash when digging nodes with a tool which
does not have _mcl_digroups in their item definition.
This commit is contained in:
Elias Åström 2021-03-20 11:02:16 +01:00
parent eb1af8902d
commit 9d38f0d01b
1 changed files with 1 additions and 1 deletions

View File

@ -209,7 +209,7 @@ function mcl_autogroup.can_harvest(nodename, toolname)
-- Check if it can be dug by tool
local tdef = minetest.registered_tools[toolname]
if tdef then
if tdef and tdef._mcl_diggroups then
for g, gdef in pairs(tdef._mcl_diggroups) do
if ndef.groups[g] then
if ndef.groups[g] <= gdef.level then