Module:ModifierTables: Difference between revisions

ModifierTable should now sort alphabetically when more than one modifier is requested
(Fix call to Shop.getPurchases() following fix)
(ModifierTable should now sort alphabetically when more than one modifier is requested)
Line 169: Line 169:


   local hasOtherModifiers = false
   local hasOtherModifiers = false
  local modifierCount = Shared.tableCount(modifiers)


   if skill == '' then
   if skill == '' then
Line 311: Line 312:


   table.sort(tableArray, function(a, b)
   table.sort(tableArray, function(a, b)
                           if 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.name ~= b.name then
                           elseif a.name ~= b.name then