Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-19-09, 04:10 PM   #1
Barjack
A Black Drake
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 89
Thumbs down When UnitReaction returns nil

So, when a bar has bar.colorReaction set to true, the default health update function can behave a little oddly. The check on that line is simply
Code:
elseif(bar.colorReaction) then
which does not guarantee there is a valid reaction for the unit. For instance on a target frame without something like colorClassPet, targeting a partypet in a different instance will return nil. As a result the bar's color is not changed at all and it will just retain the color of the previously targeted unit.

I'm not 100% sure if this would be considered a bug but, the way that if chain works makes it feel like it's supposed to continue falling through until it finds a valid color for the bar. But as long as colorReaction is true it cannot fall through to colorSmooth or colorHealth ever, even if there is no valid reaction for the unit.

Anyway, in my copy I just stuck
Code:
and UnitReaction(unit, "player") ~= nil
onto the end of that condition. But I don't know if that was specifically not done for performance reasons, or if it was just an oversight, or if it's intentional design or what, so I thought I'd at least bring it up.
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » When UnitReaction returns nil


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off