Bug: doors had a error on open

This commit is contained in:
Coder12a 2019-01-19 09:14:22 -06:00
parent fd6bf07064
commit 424ef678e7

View File

@ -89,11 +89,20 @@ for i,k in ipairs(doors) do
def_after_place_node(pos, node, clicker, itemstack, pointed_thing)
end
end
clonenode.can_dig = function(pos, digger)
if factions.can_use_node(pos, digger:get_player_name(),"door") then
return def_can_dig(pos, digger)
if def_can_dig then
clonenode.can_dig = function(pos, digger)
if factions.can_use_node(pos, digger:get_player_name(),"door") then
return def_can_dig(pos, digger)
end
return false
end
else
clonenode.can_dig = function(pos, digger)
if factions.can_use_node(pos, digger:get_player_name(),"door") then
return true
end
return false
end
return false
end
minetest.register_node(":"..k,clonenode)
end