Thread: Z-Perl 2
View Single Post
03-09-16, 07:10 PM   #32
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
About your addon, i think you should stop updating the castbar when the cast frame is not visible, else it can get called pointlessly.

I give you an example when you spam Battle Shout or any spells in between the global cooldown it triggers a lot of "UNIT_SPELLCAST_FAILED" events (even more if it's a macro with multiple spells) which runs your OnUpdate script, on every event calls at least once.

The best method is to create the onupdate script on the cast frame or the statusbar itself, then you don't even need to enable/kill the onupdate script. Since when the frame is visible it will run, when it's hidden it's killed automatically.

OnUpdate never runs on a hidden frame.
  Reply With Quote