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

мНет описания правки
мНет описания правки
Строка 107: Строка 107:
     end
     end


     if #initialTables == 0 then
    local allRelatedTables = {}
         return "Таблица, содержащая предмет с id " .. targetId .. ", не найдена."
     if #initialTables > 0 then
         allRelatedTables = findRelatedTables(initialTables)
     end
     end
    local allRelatedTables = findRelatedTables(initialTables)


     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.id and storage.id == targetId then
 
             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