Skip to content

Commit

Permalink
Fix reported TooltipScanning error from reputation (#16)
Browse files Browse the repository at this point in the history
I'm not sure why an index that's within range of GetNumFactions would
return nil data from GetFactionDataByIndex, so we probably need to
figure out what's up with that. Maybe the value returned by
GetNumFactions is only a valid input in some other GetFactionDataBy
variant?

Ref:
* https://www.wowace.com/projects/ice-hud/issues/366
* https://www.curseforge.com/projects/5394?comment=7333
  • Loading branch information
parnic authored Aug 26, 2024
1 parent 7cf02c9 commit fc9ba7a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Categories/Reputation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@ if C_Reputation and C_Reputation.GetNumFactions then
local function iter()
for i = 1, GetNumFactions() do
local data = GetFactionDataByIndex(i)
if data.isHeader == 1 then
if data.isCollapsed == 1 then
local NumFactions = GetNumFactions()
ExpandFactionHeader(i)
currentOpenHeader = i
NumFactions = GetNumFactions() - NumFactions
for j = i+1, i+NumFactions do
yield(GetFactionInfo(j))
if data then
if data.isHeader == 1 then
if data.isCollapsed == 1 then
local NumFactions = GetNumFactions()
ExpandFactionHeader(i)
currentOpenHeader = i
NumFactions = GetNumFactions() - NumFactions
for j = i+1, i+NumFactions do
yield(GetFactionInfo(j))
end
CollapseFactionHeader(i)
currentOpenHeader = nil
end
CollapseFactionHeader(i)
currentOpenHeader = nil
else
yield(data.name, data.description, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding)
end
else
yield(data.name, data.description, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding)
end
end
end
Expand Down

0 comments on commit fc9ba7a

Please sign in to comment.