Attempt to Quick Crafting replacements (again)

This commit is contained in:
Jean-Patrick Guerrero 2023-01-21 00:43:38 +01:00
parent d55994c535
commit 3b1d569118

View File

@ -178,13 +178,9 @@ local function cache_recipes(item)
_recipes[#recipes + 1 - k] = v _recipes[#recipes + 1 - k] = v
end end
local shift = 1
local size_rpl = maxn(replacements[item]) local size_rpl = maxn(replacements[item])
local size_rcp = #_recipes local size_rcp = #_recipes
local shift = size_rcp - size_rpl
if size_rpl > size_rcp then
shift = size_rcp - size_rpl
end
for k, v in pairs(replacements[item]) do for k, v in pairs(replacements[item]) do
k += shift k += shift