From e7d03626b4f997f1cdf387d4dfb185e0135fcb4b Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 24 Dec 2023 12:18:40 +0100 Subject: [PATCH] Categories: fix error caused by inexistent ore names --- default-categories.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/default-categories.lua b/default-categories.lua index 57d3e88..cf39200 100644 --- a/default-categories.lua +++ b/default-categories.lua @@ -44,7 +44,10 @@ if unified_inventory.automatic_categorization then -- Add minable ores to minerals and everything else (pockets of stone & sand variations) to environment for _,item in pairs(minetest.registered_ores) do if item.ore_type == "scatter" then - local drop = minetest.registered_nodes[item.ore].drop + -- The NodeResolver is run *after* minetest.register_on_mods_loaded, thus the + -- existence of ore names were yet not checked or enforced. + local def = minetest.registered_nodes[item.ore] or {} + local drop = def.drop if drop and drop ~= "" then unified_inventory.add_category_item('minerals', item.ore) unified_inventory.add_category_item('minerals', drop)