From 2922421f4a88e56a0a1c819f62bf2bc287835388 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 1 Dec 2016 04:22:40 -0500 Subject: Update several mods: biome_lib, boost_cart, building_blocks, castle, homedecor, glooptest, currency, roads, invsaw, maptools, mesecons, moreblocks, nixie_tubes, pipeworks, signs_lib, technic, unified_inventory, unifiedbricks, worldedit, xban2 --- unified_inventory/api.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'unified_inventory/api.lua') diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua index 936ee72..e1b980a 100644 --- a/unified_inventory/api.lua +++ b/unified_inventory/api.lua @@ -82,9 +82,11 @@ minetest.after(0.01, function() -- appears after a “maybe” local max_start = true -- Let's iterate through the items madness! - for i=1,#def.drop.items do + -- Handle invalid drop entries gracefully. + local drop_items = def.drop.items or { } + for i=1,#drop_items do if max_items_left ~= nil and max_items_left <= 0 then break end - local itit = def.drop.items[i] + local itit = drop_items[i] for j=1,#itit.items do local dstack = ItemStack(itit.items[j]) if not dstack:is_empty() and dstack:get_name() ~= name then @@ -133,7 +135,7 @@ minetest.after(0.01, function() for _, recipes in pairs(unified_inventory.crafts_for.recipe) do for _, recipe in ipairs(recipes) do local ingredient_items = {} - for _, spec in ipairs(recipe.items) do + for _, spec in pairs(recipe.items) do local matches_spec = unified_inventory.canonical_item_spec_matcher(spec) for _, name in ipairs(unified_inventory.items_list) do if matches_spec(name) then -- cgit v1.2.3