From 424ef678e7d53c55e8984f1d4c88b4b4937d1b30 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Sat, 19 Jan 2019 09:14:22 -0600 Subject: [PATCH] Bug: doors had a error on open --- nodes.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nodes.lua b/nodes.lua index 1e018de..b10aff8 100644 --- a/nodes.lua +++ b/nodes.lua @@ -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