Fix replacements

This commit is contained in:
Jean-Patrick Guerrero 2020-07-26 16:22:04 +02:00
parent 6e6ff93d29
commit f88e0412fc

@ -709,8 +709,14 @@ local function cache_recipes(item)
_recipes[#recipes + 1 - k] = v _recipes[#recipes + 1 - k] = v
end end
local shift = 0
if maxn(replacements[item]) > #_recipes then
shift = -1
end
for k, v in pairs(replacements[item]) do for k, v in pairs(replacements[item]) do
_recipes[k].replacements = v _recipes[k + shift].replacements = v
end end
recipes = _recipes recipes = _recipes