oUF

97.2k Downloads

realUnit

freebaser opened this issue ยท 9 comments

commented

realUnit in tags always return nil.

commented

are you using realUnit as a global variable, or as a function argument?

commented

argument.
oUF.Tags['freebgrid:name'] = function(u, r)
local name = UnitName(r or u) or "unknown"
return name
end
Tied to UNIT_NAME_UPDATE when I switch to a vehicle, r is still nil.

commented

I'm still not able to reproduce it.

I'm seeing the following when switching to a vehicle here:
1119.05| unit: target realUnit: nil
1119.05| unit: vehicle realUnit: player
1119.06| unit: player realUnit: pet
1119.06| unit: player realUnit: pet

commented

Thats odd... I'm not sure what is different but I still get nothing from that argument. Also, how would I define realUnit as a global?

commented

You don't define realUnit. It should only exist as an argument to the function. That being said, oUF creates a fake global environment for the tags, which contain some special globals. I was unsure if you thought realUnit existed among those.

commented

I found my issue, realUnit is only updated for player/pet frames. I want to use it for all units. Is that possible?

commented

It should be update for all units, there might however be issues with range on party members.

commented

Seems my issue was using a tag inside the PostUpdate health. Passing unit through the function will not work with realunit. You can close this if you like.

commented

Well, that explains why I wasn't able to recreate it :P