Fix crash when digging unknown nodes

This commit is contained in:
Jeija 2012-12-10 21:14:03 +01:00
parent 59a39204a9
commit 192b9eca4f

View File

@ -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}