View Single Post
03/10/17, 10:20 AM   #3
Solinur
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 78
You will get one event with the unittag = "player" and a second one with the unittag "group1" assuming that group1 is the player. Both will return true to IsUnitPlayer(unitTag) obviously. You can either just use unittag == "player" to select only for those events.

If you want to have a more elegent version you can try to use AddfilterForEvent:

Lua Code:
  1. EVENT_MANAGER:AddFilterForEvent([same as name as in your event declaration], EVENT_UNIT_DEATH_STATE_CHANGED,  REGISTER_FILTER_UNIT_TAG , "player")

Then the event will only fire if the unittag matches "player". But I guess you usually won't get flooded with death events to a point where perfomance is an issue

Btw: This happens with all events where a target might have more then one unittag, also the unittags "reticleover", "reticleoverplayer" and "reticleovertarget" can cause similar issues.

PS: more on AddFilterForEvent is here: http://wiki.esoui.com/AddFilterForEvent

Last edited by Solinur : 03/10/17 at 10:23 AM.
  Reply With Quote