Skip to content

Commit

Permalink
Categories: fix error caused by inexistent ore names
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Dec 24, 2023
1 parent 693ca11 commit e7d0362
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion default-categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e7d0362

Please sign in to comment.