Modification de Module:Fiche de créature
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 116 : | Ligne 116 : | ||
local rows = part.rows | local rows = part.rows | ||
if | -- expand parameters so that we have a list of tables | ||
return | local i = 1 | ||
end | |||
while (i <= #rows) do | |||
local l = rows[i] | |||
if type(l) == 'function' then | |||
l = l(localdata, localdata.item) | |||
end | |||
if (type(l) == 'table') and (l.type == 'multi') then | |||
table.remove(rows, i) | |||
for j, row in ipairs(l.rows) do | |||
table.insert(rows, i + j - 1, row) | |||
end | |||
elseif type(l) == 'nil' then | |||
table.remove(rows, i) | |||
elseif type(l) ~= 'table' then | |||
return error('les lignes d\'infobox ("rows") doivent être des tables, est ' .. type(l)) | |||
else | |||
i = i + 1 | |||
end | |||
end | |||
-- CREATE ROW | -- CREATE ROW |