fix
This commit is contained in:
parent
2385626976
commit
e8a99ed17c
2 changed files with 15 additions and 1 deletions
|
|
@ -9,10 +9,11 @@ if mods["crafting-efficiency-2"] then
|
|||
-- add remaining recipes with direct items to find the icons
|
||||
if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe])
|
||||
and not eff_data[recipe] and
|
||||
recipe ~= "alumina" and -- for some reason this does not work, despite having a main_product
|
||||
(data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then
|
||||
eff_data[recipe] = {
|
||||
max = 15,
|
||||
icon = data.raw.item[recipe] and data.raw.item[recipe].icon or data.raw.fluid[recipe].icon,
|
||||
icon = util.get_item_or_fluid_icon(recipe),
|
||||
crafting = { efficiency = 10 },
|
||||
research = { level = 6 },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -963,6 +963,19 @@ function util.set_item_icons(item_name, icons)
|
|||
end
|
||||
end
|
||||
|
||||
-- Gets an item or fluid icon
|
||||
function util.get_item_or_fluid_icon(name)
|
||||
icon = ""
|
||||
if data.raw.item[name] then
|
||||
icon = data.raw.item[name].icon
|
||||
if not icon then icon = data.raw.item[name].icons[1].icon end
|
||||
elseif data.raw.fluid[name] then
|
||||
icon = data.raw.fluid[name].icon
|
||||
if not icon then icon = data.raw.fluid[name].icons[1].icon end
|
||||
end
|
||||
return icon
|
||||
end
|
||||
|
||||
function util.set_to_founding(recipe, options)
|
||||
util.set_category(recipe, "founding", options)
|
||||
util.set_subgroup(recipe, "foundry-intermediate", options)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue