oUF Experience

60.8k Downloads

Issue [experience:per] and [experience:perrested]

sbaildon opened this issue ยท 1 comments

commented

I've never properly took the time to understand how oUF tags work, but I've run into an issue with [experience:per] and [experience:perrested].

I'm running latest oUF:master, and oUF_Experience:master

I've worked around the issue for now, by replacing [experience:per] with:

['experience:per'] = function(unit)
    local cur = (IsWatchingHonorAsXP() and UnitHonor or UnitXP) ('player')
    local max = (IsWatchingHonorAsXP() and UnitHonorMax or UnitXPMax) ('player')
    return math.floor(cur / max * 100 + 0.5)
end,

Am I doing something wrong?

Stack:

Message: ...\sInterface\embeds\oUF_Experience\oUF_Experience.lua:13: attempt to call field 'curxp' (a nil value)
Time: 04/23/17 22:03:09
Count: 1
Stack: ...\sInterface\embeds\oUF_Experience\oUF_Experience.lua:13: in function `?'
...rface\AddOns\sInterface\embeds\oUF\elements\tags.lua:641: in function `UpdateTag'
...rface\AddOns\sInterface\embeds\oUF\elements\tags.lua:472: in function `func'
Interface\AddOns\sInterface\embeds\oUF\ouf.lua:159: in function <Interface\AddOns\sInterface\embeds\oUF\ouf.lua:148>
(tail call): ?

Locals: unit = "player"
(*temporary) = <function> defined =[C]:-1
(*temporary) = nil
(*temporary) = "player"
(*temporary) = "attempt to call field 'curxp' (a nil value)"
commented

I see the issue, thanks for reporting.