Module:Attacks/Tables: Difference between revisions

_getSpecialAttackTable: Fix ancient magicks being unintentionally excluded from output
(Use printError function)
(_getSpecialAttackTable: Fix ancient magicks being unintentionally excluded from output)
Line 70: Line 70:
         for i, spellCat in ipairs(spellCats) do
         for i, spellCat in ipairs(spellCats) do
             for j, spell in ipairs(GameData.rawData[spellCat]) do
             for j, spell in ipairs(GameData.rawData[spellCat]) do
                if spell.specialAttack ~= nil and includedAttacks[spell.specialAttack] then
            local spAttID = spell.specialAttack or spell.specialAttackID
                     local spAtt = GameData.getEntityByID('attacks', spell.specialAttack)
                if spAttID ~= nil and includedAttacks[spAttID] then
                     local spAtt = GameData.getEntityByID('attacks', spAttID)
                     if spAtt ~= nil then
                     if spAtt ~= nil then
                         table.insert(spAttTable, {id = spAtt.id, source = 'Spell', sourceSort = spell.name, sourceText = Icons.Icon({ spell.name, type = 'spell' }), chance = spAtt.defaultChance, descType = 'player' })
                         table.insert(spAttTable, {id = spAtt.id, source = 'Spell', sourceSort = spell.name, sourceText = Icons.Icon({ spell.name, type = 'spell' }), chance = spAtt.defaultChance, descType = 'player' })