loose ir2 compatibility

This commit is contained in:
Brevven 2021-02-15 03:37:20 -08:00
parent 2fb14a0438
commit 8a03a3e487
4 changed files with 23 additions and 8 deletions

View file

@ -37,6 +37,11 @@ end
function add_ingredient(recipe, ingredient, quantity)
if recipe ~= nil and recipe.ingredients ~= nil then
for _, existing in ipairs(recipe.ingredients) do
if ingredient == existing.name or ingredient == existing[1] then
return
end
end
table.insert(recipe.ingredients, {ingredient, quantity})
end
end