Модуль:Prototypes/Роль/Лодаут: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 25: | Строка 25: | ||
return 'Роль с id "' .. roleId .. '" не найдена' | return 'Роль с id "' .. roleId .. '" не найдена' | ||
end | end | ||
local printedTrinkets = {} | |||
for _, groupId in ipairs(role.groups or {}) do | for _, groupId in ipairs(role.groups or {}) do | ||
if (modeTrinkets and groupId == "Trinkets") or ((not modeTrinkets) and groupId ~= "Trinkets") then | if (modeTrinkets and groupId == "Trinkets") or ((not modeTrinkets) and groupId ~= "Trinkets") then | ||
| Строка 64: | Строка 65: | ||
if not skipLoadout then | if not skipLoadout then | ||
if modeTrinkets then | if modeTrinkets then | ||
local items = {} | |||
if loadout.storage and loadout.storage.back then | if loadout.storage and loadout.storage.back then | ||
for _, item in ipairs(loadout.storage.back) do | for _, item in ipairs(loadout.storage.back) do | ||
table.insert( | table.insert(items, item) | ||
end | end | ||
elseif loadout.equipment then | elseif loadout.equipment then | ||
for _, eqValue in pairs(loadout.equipment) do | for _, eqValue in pairs(loadout.equipment) do | ||
table.insert( | table.insert(items, eqValue) | ||
break | break | ||
end | |||
end | |||
for _, trinket in ipairs(items) do | |||
if not printedTrinkets[trinket] then | |||
printedTrinkets[trinket] = true | |||
table.insert(results, '{{#invoke:Prototypes/Предмет/Содержание|frame|' .. trinket .. '}}') | |||
end | end | ||
end | end | ||