Модуль:Prototypes/Хранилище/Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 57: | Строка 57: | ||
result = result .. formatContent(content) | result = result .. formatContent(content) | ||
end | end | ||
return result | |||
end | |||
local function getContainedOutput(data, id, wrapped) | |||
local item = findDataById(data, id) | |||
if not item then return '' end | |||
local result = '' | |||
if item.StorageFill and item.StorageFill.contents then | |||
result = result .. getContentsOutput(item.StorageFill.contents) | |||
elseif item.EntityTableContainerFill and item.EntityTableContainerFill.containers then | |||
local containers = item.EntityTableContainerFill.containers | |||
local tableId = containers.storagebase and containers.storagebase.tableId | |||
or containers.entity_storage and containers.entity_storage.tableId | |||
or containers.other_storage and containers.other_storage.tableId | |||
local rolls = containers.storagebase and containers.storagebase.rolls and containers.storagebase.rolls.value | |||
or containers.entity_storage and containers.entity_storage.rolls and containers.entity_storage.rolls.value | |||
or 1 | |||
if tableId then | |||
result = result .. getTableOutput(tableId, rolls) | |||
else | |||
result = result .. 'Таблица не найдена.' | |||
end | |||
end | |||
return result | return result | ||
end | end | ||