This commit is contained in:
Brevven 2022-01-31 11:05:54 -08:00
parent 2987ebcf7e
commit 195dc3739e

View file

@ -89,9 +89,14 @@ function util.add_effect(technology_name, effect)
local technology = data.raw.technology[technology_name] local technology = data.raw.technology[technology_name]
if technology then if technology then
if not technology.effects then technology.effects = {} end if not technology.effects then technology.effects = {} end
if effect and effect.type == "unlock-recipe" then
if not data.raw.recipe[effect.recipe] then
return
end
table.insert(technology.effects, effect) table.insert(technology.effects, effect)
end end
end end
end
-- remove recipe unlock effect from a given technology -- remove recipe unlock effect from a given technology
function util.remove_recipe_effect(technology_name, recipe_name) function util.remove_recipe_effect(technology_name, recipe_name)