Recipe: addIngredient amount defaults to 1

This commit is contained in:
Simon Brodtmann 2025-03-14 18:13:37 +01:00
parent be0781340a
commit 27d9dd6c68

View file

@ -43,8 +43,9 @@ end
--- Adds an ingredient to the recipe
--- @param ingredientName string The name of the ingredient
--- @param amount number The amount of the ingredient
--- @param amount number The amount of the ingredient (default: 1)
function Recipe:addIngredient(ingredientName, amount)
amount = amount or 1
local ingredientType = data.raw.item[ingredientName] and "item"
or data.raw.module[ingredientName] and "item"
or data.raw.fluid[ingredientName] and "fluid"