fix crash during incorrect call of on_dig without 2nd 3rd argument

This commit is contained in:
adrido 2015-08-05 20:28:23 +02:00
parent cfb60f04ef
commit b84ed21fac

@ -177,6 +177,12 @@ cannons.stand_on_rightclick = function(pos, node, player, itemstack, pointed_thi
end end
cannons.dug = function(pos, node, digger) cannons.dug = function(pos, node, digger)
if not node or not type(node)=="table" then
return
end
if not digger or not digger:is_player() then
return
end
local cannons = minetest.registered_nodes[node.name].cannons local cannons = minetest.registered_nodes[node.name].cannons
if cannons and cannons.stand and cannons.cannon then --node dug if cannons and cannons.stand and cannons.cannon then --node dug
node.name = cannons.stand node.name = cannons.stand