mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-08-21 05:24:11 +02:00
Fix crash when digging unknown nodes
This commit is contained in:
parent
59a39204a9
commit
192b9eca4f
@ -191,17 +191,15 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_placenode(function(pos, node)
|
local update_on_place_dig = function (pos, node)
|
||||||
if minetest.registered_nodes[node.name].mesecons then
|
if minetest.registered_nodes[node.name]
|
||||||
|
and minetest.registered_nodes[node.name].mesecons then
|
||||||
mesecon:update_autoconnect(pos)
|
mesecon:update_autoconnect(pos)
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, node)
|
minetest.register_on_placenode(update_on_place_dig)
|
||||||
if minetest.registered_nodes[node.name].mesecons then
|
minetest.register_on_dignode(update_on_place_dig)
|
||||||
mesecon:update_autoconnect(pos)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function mesecon:update_autoconnect(pos, secondcall, replace_old)
|
function mesecon:update_autoconnect(pos, secondcall, replace_old)
|
||||||
local xppos = {x=pos.x+1, y=pos.y, z=pos.z}
|
local xppos = {x=pos.x+1, y=pos.y, z=pos.z}
|
||||||
|
Loading…
Reference in New Issue
Block a user