From f2a5c4255e8aaa337ba9ad419b2fe09b49a36ca1 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 20 Jul 2020 15:24:39 +0200 Subject: [PATCH] Minor cleaning --- init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index fbe8b05..36b7793 100644 --- a/init.lua +++ b/init.lua @@ -699,23 +699,22 @@ end local function cache_recipes(item) local recipes = get_all_recipes(item) - local _recipes if replacements[item] then - _recipes = {} + local _recipes = {} for k, v in ipairs(recipes or {}) do _recipes[#recipes + 1 - k] = v end for k, v in pairs(replacements[item]) do - if v.type ~= "fuel" then - _recipes[k].replacements = v - end + _recipes[k].replacements = v end + + recipes = _recipes end - recipes_cache[item] = _recipes or recipes + recipes_cache[item] = recipes end local function get_recipes(item, data, player)