Модуль:Meals Lookup: различия между версиями

Нет описания правки
Нет описания правки
Строка 17: Строка 17:


function p.getrecipetype(frame, id)
function p.getrecipetype(frame, id)
     local out = "nil"
     local out = { }
     for type, recipes in pairs(p.meals) do
     for type, recipes in pairs(p.meals) do
         for recipeId, recipe in pairs(recipes) do
         for recipeId, recipe in pairs(recipes) do
             if (recipeId:gsub(' ', '') == id:gsub(' ', '')) or (recipe["id"]:gsub(' ', '') == id:gsub(' ', '')) then
             if (recipeId:gsub(' ', '') == id:gsub(' ', '')) or (recipe["id"]:gsub(' ', '') == id:gsub(' ', '')) then
                 out = type
                 table.insert(out, type)
                 break
                 break
             end
             end