forked from minetest-mods/mesecons
Fix crash when digging unknown nodes
This commit is contained in:
parent
59a39204a9
commit
192b9eca4f
|
@ -191,17 +191,15 @@ end
|
|||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode(function(pos, node)
|
||||
if minetest.registered_nodes[node.name].mesecons then
|
||||
local update_on_place_dig = function (pos, node)
|
||||
if minetest.registered_nodes[node.name]
|
||||
and minetest.registered_nodes[node.name].mesecons then
|
||||
mesecon:update_autoconnect(pos)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
minetest.register_on_dignode(function(pos, node)
|
||||
if minetest.registered_nodes[node.name].mesecons then
|
||||
mesecon:update_autoconnect(pos)
|
||||
end
|
||||
end)
|
||||
minetest.register_on_placenode(update_on_place_dig)
|
||||
minetest.register_on_dignode(update_on_place_dig)
|
||||
|
||||
function mesecon:update_autoconnect(pos, secondcall, replace_old)
|
||||
local xppos = {x=pos.x+1, y=pos.y, z=pos.z}
|
||||
|
|
Loading…
Reference in New Issue
Block a user