Originally Posted by SDPhantom
I try to include target if you happen to be targeting yourself. Same with including focus if you have focus on yourself. With varying extents, this is what UnitIsUnit() is checking for.
|
There's no reason to check
UnitIsUnit here. If you're targeting yourself and cast a spell, then you'll get two events for the same spellcast -- one for the "player" unit, and one for the "target" unit. In this case, though, you only want to run your function once per spellcast (since you're not modifying the target castbar too) so you should just ignore the event for the "target" unit.
Code:
if unit ~= "player" or unit ~= self.unit then return end