From c45a6c95713f308d1acc5199f6fccdc02d779c48 Mon Sep 17 00:00:00 2001 From: Oversword Date: Sat, 3 Apr 2021 03:30:40 +0100 Subject: [PATCH] Better door conditions --- .luacheckrc | 1 + default-categories.lua | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 9fb6a7c..e6fec97 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -14,6 +14,7 @@ read_globals = { "ItemStack", "datastorage", "hb", + "doors", } files["callbacks.lua"].ignore = { "player", "draw_lite_mode" } diff --git a/default-categories.lua b/default-categories.lua index 5c60c6d..b4082d0 100644 --- a/default-categories.lua +++ b/default-categories.lua @@ -77,8 +77,11 @@ if unified_inventory.automatic_categorization then unified_inventory.add_category_item('environment', name) elseif def.light_source and def.light_source > 0 then unified_inventory.add_category_item('lighting', name) - elseif doors and doors.registered_doors and doors.registered_doors[name..'_a'] or - doors and doors.registered_trapdoors and doors.registered_trapdoors[name] then + elseif group.door or + minetest.global_exists("doors") and ( + doors.registered_doors and doors.registered_doors[name..'_a'] or + doors.registered_trapdoors and doors.registered_trapdoors[name] then + ) unified_inventory.add_category_item('building', name) end end