Skip to content

Commit

Permalink
Check if node is registered before trying to get content id (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuedel committed Jun 1, 2020
1 parent f761e38 commit bdf7332
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bdf7332

Please sign in to comment.