Minor cleaning

This commit is contained in:
Jean-Patrick Guerrero 2020-07-20 15:24:39 +02:00
parent d903aaca89
commit f2a5c4255e

@ -699,23 +699,22 @@ end
local function cache_recipes(item) local function cache_recipes(item)
local recipes = get_all_recipes(item) local recipes = get_all_recipes(item)
local _recipes
if replacements[item] then if replacements[item] then
_recipes = {} local _recipes = {}
for k, v in ipairs(recipes or {}) do for k, v in ipairs(recipes or {}) do
_recipes[#recipes + 1 - k] = v _recipes[#recipes + 1 - k] = v
end end
for k, v in pairs(replacements[item]) do for k, v in pairs(replacements[item]) do
if v.type ~= "fuel" then
_recipes[k].replacements = v _recipes[k].replacements = v
end end
end
recipes = _recipes
end end
recipes_cache[item] = _recipes or recipes recipes_cache[item] = recipes
end end
local function get_recipes(item, data, player) local function get_recipes(item, data, player)