Модуль:Prototypes/Хранилище/Предмет: различия между версиями

мНет описания правки
мНет описания правки
Строка 295: Строка 295:
       or not item.SolutionContainerManager  
       or not item.SolutionContainerManager  
       or not item.SolutionContainerManager.solutions then  
       or not item.SolutionContainerManager.solutions then  
        return ''
    end
    -- Сбор всех реагентов
    local allReagents = {}
    for _, solution in pairs(item.SolutionContainerManager.solutions) do
        if solution and solution.reagents then
            for _, reagent in ipairs(solution.reagents) do
                table.insert(allReagents, reagent)
            end
        end
    end
    -- Если все реагенты — это только Fiber, то не выводим ничего
    local hasNonFiber = false
    for _, reagent in ipairs(allReagents) do
        if reagent.ReagentId ~= "Fiber" then
            hasNonFiber = true
            break
        end
    end
    if not hasNonFiber then
         return ''
         return ''
     end
     end