Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 107: | Строка 107: | ||
end | end | ||
if #initialTables | local allRelatedTables = {} | ||
if #initialTables > 0 then | |||
allRelatedTables = findRelatedTables(initialTables) | |||
end | end | ||
local matchingStorages = {} | local matchingStorages = {} | ||
| Строка 117: | Строка 116: | ||
if type(storage) == "table" then | if type(storage) == "table" then | ||
local found = false | local found = false | ||
if storage.EntityTableContainerFill and storage.EntityTableContainerFill.containers then | |||
if storage.EntityTableContainerFill and storage.EntityTableContainerFill.containers and #allRelatedTables > 0 then | |||
if searchTableIdInStructure(storage.EntityTableContainerFill.containers, allRelatedTables) then | if searchTableIdInStructure(storage.EntityTableContainerFill.containers, allRelatedTables) then | ||
found = true | found = true | ||
end | end | ||
end | end | ||
if storage | |||
if searchItemInStructure(storage, targetId) then | |||
found = true | found = true | ||
end | end | ||
if found then | if found then | ||
table.insert(matchingStorages, storageId) | table.insert(matchingStorages, storageId) | ||
| Строка 132: | Строка 134: | ||
if #matchingStorages == 0 then | if #matchingStorages == 0 then | ||
return "Хранилище, | return "Хранилище, содержащее предмет с id " .. targetId .. ", не найдено." | ||
end | end | ||