This commit is contained in:
Brevven 2022-01-13 22:22:37 -08:00
parent b3b7b27797
commit b35ee619de

View file

@ -176,10 +176,17 @@ function util.add_product(recipe_name, product)
end
function add_product(recipe, product)
if recipe ~= nil and recipe.results ~= nil then
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
-- Replace one ingredient with another in a recipe
function util.replace_ingredient(recipe_name, old, new)
@ -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")