Module:Monsters: Difference between revisions

getOtherMonsterBoxText: Fix area type determination
(_getMonsterAreas: Fix slayer area icon type)
(getOtherMonsterBoxText: Fix area type determination)
Line 614: Line 614:


local areaList = Areas.getMonsterAreas(monster.id)
local areaList = Areas.getMonsterAreas(monster.id)
local counts = {combat = 0, slayer = 0, dungeon = 0}
local counts = {combatArea = 0, slayerArea = 0, dungeon = 0}
for i, area in ipairs(areaList) do
for i, area in ipairs(areaList) do
counts[area.type] = counts[area.type] + 1
counts[area.type] = counts[area.type] + 1
end
end


if counts.combat > 0 then table.insert(monsterTypes, 'Combat Area') end
if counts.combatArea > 0 then table.insert(monsterTypes, 'Combat Area') end
if counts.slayer > 0 then table.insert(monsterTypes, 'Slayer Area') end
if counts.slayerArea > 0 then table.insert(monsterTypes, 'Slayer Area') end
if counts.dungeon > 0 then table.insert(monsterTypes, 'Dungeon') end
if counts.dungeon > 0 then table.insert(monsterTypes, 'Dungeon') end