Модуль:tableofchemicals
| Строка 23: | Строка 23: | ||
-- Если нет продуктов, пропускаем эту реакцию | -- Если нет продуктов, пропускаем эту реакцию | ||
if mainProduct | if mainProduct ~= nil then | ||
-- Заполняем данные для колонки "Вещество" | -- Заполняем данные для колонки "Вещество" | ||
templateArgs.id = mainProduct.id | templateArgs.id = mainProduct.id | ||
| Строка 64: | Строка 62: | ||
-- Эффекты реакции | -- Эффекты реакции | ||
if tablelength(reactPrototype.effects) then | if reactPrototype.effects and tablelength(reactPrototype.effects) > 0 then | ||
for _, effect in pairs(reactPrototype.effects) do | for _, effect in pairs(reactPrototype.effects) do | ||
if effect.description ~= "" then | if effect.description ~= "" then | ||
| Строка 204: | Строка 202: | ||
end | end | ||
-- Эффекты реакции | -- Эффекты реакции | ||
if tablelength(reactPrototype.effects) then | if reactPrototype.effects and tablelength(reactPrototype.effects) > 0 then | ||
for _, effect in pairs(reactPrototype.effects) do | for _, effect in pairs(reactPrototype.effects) do | ||
if effect.description ~= "" then | if effect.description ~= "" then | ||
| Строка 231: | Строка 229: | ||
local actions = {} | local actions = {} | ||
for _, mixingCategory in pairs(reactPrototype.mixingCategories) do | if reactPrototype.mixingCategories then | ||
for _, mixingCategory in pairs(reactPrototype.mixingCategories) do | |||
local image = getMixingImage(mixingCategory.id) | |||
if image ~= nil then | |||
table.insert(actions, string.format("[[File:%s|32px|link=]]", image)) -- Картинка | |||
end | |||
table.insert(actions, mixingCategory.name or mixingCategory.id) -- Название | |||
end | end | ||
end | end | ||