From 82623ae8e9fdfdc8bad18260df8d57a1c361c473 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 8 Jul 2018 11:27:02 +0300 Subject: [PATCH] update sort --- ElvUI/Modules/Bags/Sort.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ElvUI/Modules/Bags/Sort.lua b/ElvUI/Modules/Bags/Sort.lua index 062b11f..36cc526 100644 --- a/ElvUI/Modules/Bags/Sort.lua +++ b/ElvUI/Modules/Bags/Sort.lua @@ -152,8 +152,12 @@ local function UpdateLocation(from, to) end local function PrimarySort(a, b) - local aName = GetItemInfo(bagIDs[a]) - local bName = GetItemInfo(bagIDs[b]) + local aName, _, _, aLvl = GetItemInfo(bagIDs[a]) + local bName, _, _, bLvl = GetItemInfo(bagIDs[b]) + + if aLvl ~= bLvl and aLvl and bLvl then + return aLvl > bLvl + end if aName and bName then return aName < bName @@ -237,7 +241,7 @@ end local function IterateForwards(bagList, i) i = i + 1 local step = 1 - for _, bag in ipairs(bagList) do + for _, bag in bagList do local slots = B:GetNumSlots(bag) if i > slots + step then step = step + slots