From f83bc9cccff10396fbe02c44117e1f3cae28ce3b Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 27 Jul 2020 03:39:12 +0200 Subject: [PATCH] Small correction --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 219a2a9..4eeb792 100644 --- a/init.lua +++ b/init.lua @@ -710,9 +710,11 @@ local function cache_recipes(item) end local shift = 0 + local size_rpl = maxn(replacements[item]) + local size_rcp = #_recipes - if maxn(replacements[item]) > #_recipes then - shift = -1 + if size_rpl > size_rcp then + shift = size_rcp - size_rpl end for k, v in pairs(replacements[item]) do