Fix server crash when players dig unknown nodes

Digging unknown nodes crashes the Clamity Minetest server, which
runs modified Minetest: https://github.com/ClamityAnarchy/minetest
Crashes did occur with commit d5434bf008 of that Minetest version.

This commit makes unknown nodes explicitly not harvestable.
This commit is contained in:
cora 2021-06-15 01:13:24 +02:00 committed by Nils Dagsson Moskopp
parent 031ae5fcb5
commit 79766bff23
Signed by untrusted user who does not match committer: erle
GPG Key ID: A3BC671C35191080
1 changed files with 4 additions and 0 deletions

View File

@ -207,6 +207,10 @@ end
function mcl_autogroup.can_harvest(nodename, toolname)
local ndef = minetest.registered_nodes[nodename]
if not ndef then
return false
end
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
return true
end