View Single Post
07/10/19, 03:41 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
You are mistaken. Event handlers can only be registered once for the same eventNamespace/eventId pair. EVENT_MANAGER:RegisterForEvent returns true if it actually registered the function and false otherwise. In order to assign a different function you have to first call UnregisterForEvent for the same namespace and id, which will also return true in case it did unregister something.

The reason why you see your handler getting called more than once is that some abilities have more than one effect. I tried your code with Shadowy Disguise (id 62141) and it is called 2 times when it is cast and one more time when the invisibility runs out.
  Reply With Quote