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

Нет описания правки
Нет описания правки
Метка: ручная отмена
Строка 112: Строка 112:
         out[type] = {}
         out[type] = {}
         for recipeId, recipe in pairs(recipes) do
         for recipeId, recipe in pairs(recipes) do
             if string.find(recipeId, str) ~= nil then
             if string.match(recipeId, str) then
                 table.insert(out[type], recipe)
                 table.insert(out[type], recipe)
             end
             end
Строка 124: Строка 124:
     local out = {}
     local out = {}
     for type, recipes in pairs(tabl) do
     for type, recipes in pairs(tabl) do
         out[type] = {}
         if not table.containsk(out, type) then
            out[type] = {}
        end
         for recipeId, recipe in pairs(recipes) do
         for recipeId, recipe in pairs(recipes) do
             if string.find(recipeId, str) ~= nil then break end
             if not string.match(recipeId, str) then
            table.insert(out[type], recipe)
                if not table.containsv(out[type], recipe) then
                    table.insert(out[type], recipe)
                end
            end
         end
         end
     end
     end