From 671fae892627f57293d8eadc343ebf0c299d08bc Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 11 Dec 2020 02:14:28 +0100 Subject: [PATCH] Fix bug --- init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 72bf6b3..e3d2eb6 100644 --- a/init.lua +++ b/init.lua @@ -897,7 +897,7 @@ local function craft_stack(player, pname, data, craft_rcp) local output = craft_rcp and data.recipes[data.rnum].output or data.usages[data.unum].output output = ItemStack(output) local stackname, stackcount = output:get_name(), output:get_count() - local scrbar_val = data[sprintf("scrbar_%s", craft_rcp and "rcp" or "usg")] + local scrbar_val = data[sprintf("scrbar_%s", craft_rcp and "rcp" or "usg")] or 1 for name, count in pairs(data.export_counts[rcp_usg].rcp) do local items = {[name] = count} @@ -1433,6 +1433,14 @@ local function get_rcp_extra(fs, data, panel, is_recipe, is_usage) max_stacks_usg = get_stack_max(data, is_recipe, panel.rcp[data.unum]) end + if is_recipe and max_stacks_rcp == 0 then + data.export_rcp = nil + data.scrbar_rcp = 1 + elseif is_usage and max_stacks_usg == 0 then + data.export_usg = nil + data.scrbar_usg = 1 + end + if max_stacks_rcp > 0 or max_stacks_usg > 0 then get_export_fs(fs, data, panel, is_recipe, is_usage, max_stacks_rcp, max_stacks_usg)