diff --git a/cf-lib/data/Technology.lua b/cf-lib/data/Technology.lua index d1d1dbb..d6d82f1 100644 --- a/cf-lib/data/Technology.lua +++ b/cf-lib/data/Technology.lua @@ -132,6 +132,11 @@ end --- Adds a recipe unlock to the technology --- @param recipeName string The name of the recipe to unlock function Technology:addRecipe(recipeName) + for _, effect in pairs(self.prototype.effects) do + if effect.type == "unlock-recipe" and effect.recipe == recipeName then + return + end + end table.insert(self.prototype.effects, { type = "unlock-recipe", recipe = recipeName }) end