Skip to content

Commit

Permalink
Fix bug comparing non-number types in the Calcs tab (#7315)
Browse files Browse the repository at this point in the history
* Fixes #3714: Only compare number types

* Add the same check to another spot
  • Loading branch information
Wires77 authored Jan 26, 2024
1 parent 2a2b454 commit 1141424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
-- Sort modifiers by type
table.sort(rowList, function(a, b)
if a.mod.type == b.mod.type then
return a.mod.name > b.mod.name or a.mod.name == b.mod.name and a.value > b.value
return a.mod.name > b.mod.name or (a.mod.name == b.mod.name and type(a.value) == "number" and type(b.value) == "number") and a.value > b.value
else
return a.mod.type < b.mod.type
end
end)
else -- Sort modifiers by value
table.sort(rowList, function(a, b)
return a.mod.name > b.mod.name or a.mod.name == b.mod.name and a.value > b.value
return a.mod.name > b.mod.name or (a.mod.name == b.mod.name and type(a.value) == "number" and type(b.value) == "number") and a.value > b.value
end)
end

Expand Down

0 comments on commit 1141424

Please sign in to comment.