fix bob issue

This commit is contained in:
Brevven 2025-05-03 03:10:37 -07:00
parent 3118876e02
commit 1f3fe9cbb8
4 changed files with 18 additions and 4 deletions

View file

@ -754,8 +754,17 @@ function util.add_effect(technology_name, effect)
if not data.raw.recipe[effect.recipe] then
return
end
table.insert(technology.effects, effect)
end
table.insert(technology.effects, effect)
end
end
-- Make a technology boost productivity for a recipe
function util.add_to_productivity_research(technology_name, recipe_name, amount)
if not amount then amount = 0.1 end
local recipe = data.raw.recipe[recipe_name]
if recipe then
util.add_effect(technology_name, { type = "change-recipe-productivity", recipe = recipe_name, change = amount})
end
end
@ -1321,7 +1330,7 @@ end
-- Replace one product with another in a recipe
function util.replace_product(recipe_name, old, new, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
replace_product(data.raw.recipe[recipe_name], old, new, options)
end
end