Do not crash when a skeleton key is used on an unknown node
* backported from default MT 5.1+
This commit is contained in:
parent
574d6cc65c
commit
d18f9b4251
@ -216,7 +216,8 @@ minetest.register_craftitem("default:skeleton_key", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_skeleton_key_use = minetest.registered_nodes[node.name].on_skeleton_key_use
|
local node_reg = minetest.registered_nodes[node.name]
|
||||||
|
local on_skeleton_key_use = node_reg and node_reg.on_skeleton_key_use
|
||||||
if not on_skeleton_key_use then
|
if not on_skeleton_key_use then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user