Модуль:Prototypes/Роль/Лодаут: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 36: | Строка 36: | ||
end | end | ||
if group then | if group then | ||
if type( | local loadouts = group.loadouts or {} | ||
local success, decoded = pcall(mw.text.jsonDecode, | if type(loadouts) == "string" then | ||
local success, decoded = pcall(mw.text.jsonDecode, loadouts) | |||
if success and type(decoded) == "table" then | if success and type(decoded) == "table" then | ||
loadouts = decoded | |||
else | else | ||
loadouts = {} | |||
end | end | ||
end | end | ||
for _, loadoutId in ipairs( | for _, loadoutId in ipairs(loadouts) do | ||
local loadout = nil | local loadout = nil | ||
for _, l in ipairs(gearloadout) do | for _, l in ipairs(gearloadout) do | ||