loose ir2 compatibility
This commit is contained in:
parent
2fb14a0438
commit
8a03a3e487
4 changed files with 23 additions and 8 deletions
5
util.lua
5
util.lua
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue