Skip to content

Commit 0a88c2c

Browse files
committed
Update faction API for TBC Anniversary
1 parent d319b26 commit 0a88c2c

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.luacheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ read_globals = {
4545
-- API functions
4646
"C_AddOns",
4747
"C_PartyInfo",
48+
"C_Reputation",
4849
"C_Timer",
4950
"CancelUnitBuff",
5051
"CanHearthAndResurrectFromArea",

modules/xp.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,19 @@ end
8686

8787
function XP:UpdateRep(frame)
8888
if( not frame.xpBar.rep ) then return end
89-
local name, reaction, min, max, current = GetWatchedFactionInfo()
89+
local name, reaction, min, max, current
90+
if C_Reputation and C_Reputation.GetWatchedFactionData then
91+
local factionData = C_Reputation.GetWatchedFactionData()
92+
if factionData then
93+
name = factionData.name
94+
reaction = factionData.reaction
95+
min = factionData.currentReactionThreshold
96+
max = factionData.nextReactionThreshold
97+
current = factionData.currentStanding
98+
end
99+
elseif GetWatchedFactionInfo then
100+
name, reaction, min, max, current = GetWatchedFactionInfo()
101+
end
90102
if( not name ) then
91103
frame.xpBar.rep:Hide()
92104
return

0 commit comments

Comments
 (0)