Модуль:Сущность: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 155: | Строка 155: | ||
local foundComponents, foundPrototypes = {}, {} | local foundComponents, foundPrototypes = {}, {} | ||
local compList = componentDefs[id] | local compList = componentDefs[id] | ||
if type(compList) == "table" then for _, v in ipairs(compList) do if type(v) == "string" then foundComponents[v] = true end end end | if type(compList) == "table" then | ||
local | for _, v in ipairs(compList) do | ||
if type( | if type(v) == "string" then | ||
foundComponents[v] = true | |||
end | |||
end | |||
end | |||
local protoEntry = prototypeDefs[id] | |||
if type(protoEntry) == "table" then | |||
for protoName, _ in pairs(protoEntry) do | |||
if type(protoName) == "string" then | |||
foundPrototypes[protoName] = true | |||
end | |||
end | |||
end | |||
for name in string.gmatch(id, "[^,]+") do | for name in string.gmatch(id, "[^,]+") do | ||
local n = trim(name) | local n = trim(name) | ||
if n ~= "" then | if n ~= "" then | ||
if componentDefs[n] ~= nil then foundComponents[n] = true end | if componentDefs[n] ~= nil then foundComponents[n] = true end | ||
if componentDefs[n] == nil and prototypeDefs[n] == nil then foundComponents[n] = true end | if componentDefs[n] == nil and prototypeDefs[n] == nil then foundComponents[n] = true end | ||
end | end | ||