mirror of
https://github.com/minetest-mods/ropes.git
synced 2025-01-21 05:21:26 +01:00
Check if node is registered before trying to get content id (#20)
This commit is contained in:
parent
f761e38794
commit
bdf7332dda
@ -51,8 +51,10 @@ ropes.destroy_rope = function(pos, nodes)
|
|||||||
local finished = false
|
local finished = false
|
||||||
local ids_to_destroy = {}
|
local ids_to_destroy = {}
|
||||||
for _, node in pairs(nodes) do
|
for _, node in pairs(nodes) do
|
||||||
|
if minetest.registered_nodes[node] then
|
||||||
ids_to_destroy[minetest.get_content_id(node)] = true
|
ids_to_destroy[minetest.get_content_id(node)] = true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
while not finished do
|
while not finished do
|
||||||
local emin, emax = voxel_manip:read_from_map({x=pos.x, y=bottom, z=pos.z}, {x=pos.x, y=top, z=pos.z})
|
local emin, emax = voxel_manip:read_from_map({x=pos.x, y=bottom, z=pos.z}, {x=pos.x, y=top, z=pos.z})
|
||||||
|
Loading…
Reference in New Issue
Block a user