• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 439: Line 439:  
         if args.sort and sequence and not sorted then
 
         if args.sort and sequence and not sorted then
 
         sorted = true
 
         sorted = true
 +
        local sorts = mw.text.split(args.sort, "%s*,%s*")
 
         table.sort(sequence, function(a, b)
 
         table.sort(sequence, function(a, b)
 
         local a = Ship(a)
 
         local a = Ship(a)
 
         local b = Ship(b)
 
         local b = Ship(b)
      local x = a[args.sort](a)
+
        for _, sort in ipairs(sorts) do
      local y = b[args.sort](b)
+
      local x = a[sort](a)
if x < y then return true
+
      local y = b[sort](b)
elseif x == y then return a:sort_id() < b:sort_id()
+
      if x < y then return true end
else return false end
+
      if x > y then return false end
 +
        end
 +
return false
 
end)
 
end)
 
         end
 
         end
cssedit, gkautomate
7,064

edits

Navigation menu