Check if node is registered before trying to get content id (#20)

This commit is contained in:
tuedel 2020-06-01 11:10:20 +02:00 committed by GitHub
parent f761e38794
commit bdf7332dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,7 +51,9 @@ ropes.destroy_rope = function(pos, nodes)
local finished = false
local ids_to_destroy = {}
for _, node in pairs(nodes) do
ids_to_destroy[minetest.get_content_id(node)] = true
if minetest.registered_nodes[node] then
ids_to_destroy[minetest.get_content_id(node)] = true
end
end
while not finished do