Модуль:Песочница/Pok: различия между версиями

Нет описания правки
Нет описания правки
Строка 124: Строка 124:
})
})
elseif recipe and recipe.resultReagents then
elseif recipe and recipe.resultReagents then
for reagent, amount in pairs(recipe.resultReagents) do
    for reagent, amount in pairs(recipe.resultReagents) do
if type(reagent) == "string" and reagent ~= "category" then
        local reagentName = chemMapping[reagent] or reagent
local reagentName = chemMapping[reagent] or reagent
        table.insert(recipes, {
table.insert(recipes, {
            result = reagentName .. "|amount=" .. amount .. "ед.|mode-chem=1",
result = reagentName .. "|amount=" .. amount .. "ед.|mode-chem=1",
            completetime = recipe.completetime,
completetime = recipe.completetime,
            materials = recipe.materials,
materials = recipe.materials,
            discipline = "Static",
discipline = "Static",
            tier = 0
tier = 0
        })
})
        break  
break  
    end
end
end
else
else
out = out .. '<div style="color:red;">Ошибка: Рецепт с ID "' .. recipeId .. '" не найден или поля result/resultReagents отсутствуют.</div>'
out = out .. '<div style="color:red;">Ошибка: Рецепт с ID "' .. recipeId .. '" не найден или поля result/resultReagents отсутствуют.</div>'