From b35ee619deda1fd5a2512f8e72a4d34fe6854a8b Mon Sep 17 00:00:00 2001 From: Brevven Date: Thu, 13 Jan 2022 22:22:37 -0800 Subject: [PATCH] update --- data-util.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/data-util.lua b/data-util.lua index 353293e..6211377 100644 --- a/data-util.lua +++ b/data-util.lua @@ -176,8 +176,15 @@ function util.add_product(recipe_name, product) end function add_product(recipe, product) - if recipe ~= nil and recipe.results ~= nil then - table.insert(recipe.results, product) + if recipe ~= nil then + if not recipe.normal then + if recipe.results == nil then + recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}} + end + recipe.result = nil + recipe.result_count = nil + table.insert(recipe.results, product) + end end end @@ -457,6 +464,17 @@ function util.set_subgroup(recipe_name, subgroup) end end +-- Set recipe icons +function util.set_icons(recipe_name, icons) + if me.bypass[recipe_name] then return end + if data.raw.recipe[recipe_name] then + me.add_modified(recipe_name) + data.raw.recipe[recipe_name].icons = icons + data.raw.recipe[recipe_name].icon = nil + data.raw.recipe[recipe_name].icon_size = nil + end +end + function util.set_to_founding(recipe) util.set_category(recipe, "founding") util.set_subgroup(recipe, "foundry-intermediate")