From 27d9dd6c68abb3f69dea7aaec250b45ae096e4b6 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 14 Mar 2025 18:13:37 +0100 Subject: [PATCH] Recipe: addIngredient amount defaults to 1 --- cf-lib/data/Recipe.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cf-lib/data/Recipe.lua b/cf-lib/data/Recipe.lua index 52e453b..4bbd0f1 100644 --- a/cf-lib/data/Recipe.lua +++ b/cf-lib/data/Recipe.lua @@ -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"