Noticed another thing, shouldn't it be PreAuraSetPosition(debuffs, max)
Sorting with only returning true errors out because it means everything should be before everything else. Only returning false gives you some weird sort orders.
If you're gonna sort,
you have to sort.
Basically the sorting function is; Should A (true) be before B (false) and it keeps going until it's looped over the whole table to get the new order.
Edit: Can't you use " return a:GetID() < b:GetID() " at the end for the default UnitAura() order?
if prio[a.name] and not prio[b.name] then return true -- A has priority over B
elseif prio[b.name] and not prio[a.name] then return false -- B has priority over A
else return a:GetID() < b:GetID() -- Default UnitDebuff index order
|