From 7c210a584141176f45bdeba82163b2f1fa53d749 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Thu, 15 Jun 2023 03:40:46 +0200 Subject: [PATCH] bugfix: when item has no groups "" and unknown items have no def and thus no groups --- autocrafter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autocrafter.lua b/autocrafter.lua index ec79ee2..c3eaac5 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -125,7 +125,7 @@ local function calculate_consumption(inv_index, consumption_with_groups) for i = 1, #groups do local group = groups[i] local groupname = "group:" .. group - if item_groups[group] >= 1 and consumption_with_groups[groupname] > 0 then + if item_groups[group] and item_groups[group] >= 1 and consumption_with_groups[groupname] > 0 then local take = math.min(count, consumption_with_groups[groupname]) consumption_with_groups[groupname] = consumption_with_groups[groupname] - take assert(consumption_with_groups[groupname] >= 0)