4,951
edits
(Use printError function) |
Falterfire (talk | contribs) (Changed sorting for modifier tables) |
||
Line 329: | Line 329: | ||
local obstList = p.getObstaclesWithModifier(modifiers, skill, getOpposites) | local obstList = p.getObstaclesWithModifier(modifiers, skill, getOpposites) | ||
table.sort(obstList, function(a, b) return a.category < b.category end) | |||
for i, obst in Shared.skpairs(obstList) do | for i, obst in Shared.skpairs(obstList) do | ||
local row = {} | local row = {} | ||
Line 335: | Line 336: | ||
row.expIcon = Icons.getExpansionIcon(obst.id) | row.expIcon = Icons.getExpansionIcon(obst.id) | ||
row.type = '[[Agility#Obstacles|Agility Obstacle '..tostring(tonumber(obst.category)+1)..']]' | row.type = '[[Agility#Obstacles|Agility Obstacle '..tostring(tonumber(obst.category)+1)..']]' | ||
row.typeText = 'Agility Obstacle '.. | row.typeText = 'Agility Obstacle '..string.format("%02d", (obst.category + 1)) | ||
local totalVal = 0 | local totalVal = 0 | ||
for i, mod in pairs(modifiers) do | for i, mod in pairs(modifiers) do | ||
Line 450: | Line 451: | ||
if modifierCount == 1 and a.val ~= b.val then | if modifierCount == 1 and a.val ~= b.val then | ||
return a.val > b.val | return a.val > b.val | ||
elseif a. | elseif a.typeText ~= b.typeText then | ||
return a. | return a.typeText < b.typeText | ||
else | else | ||
return a.name < b.name | return a.name < b.name |