View Single Post
10-23-15, 12:45 PM   #4
LanceDH
A Cyclonian
 
LanceDH's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 41
Originally Posted by lightspark View Post
Not at home yet, can't run live tests, but here's my wild guess after I checked your code on GH... You have quite many Show/Hide calls, but you dun always check if character is in combat or not, you can't toggle frame visibility whilst in combat... You have to use InCombatLockdown() function to check whether it's safe to make those calls or not.

And I strongly recommend using taint log, it helps quite much...
It's not the best way to do things, but I have the 2main frames not work during combat and hide once you enter combat.
The other ones are (in theory) impossible to trigger without either of those 2 frames being shown.
I used UnitAffectingCombat("player") for it though. Achieves the same thing but might look into using the function you gave instead.
As for taint log, totally forgot that was a thing.

Originally Posted by semlar View Post
I think your only chance of getting this to work correctly without breaking the spellbook is to create a secure button which executes a macro to /click the spellbook forward/back buttons to the proper page, because calling any of the spellbook functions directly is going to taint everything it touches.

That being said, why not just make it so people can drag the spell off the button you're displaying, rather than open the spellbook? It seems like an extra step, unless I'm not understanding what your addon is meant to do.
Yea as I was waiting for a reply I pretty much implemented the dragging as well.
I was already going to add that but the reason I wanted to have the SpellBook is because I also do things like open the dungeon journal, talent frame, glyph frame, .. which... I'm probably also tainting beyon belief though I don't think they call protected functions like the SpellBook does.
Another annoyance is that IsPassiveSpell("name") doesn't actually work correctly as it returns false for Tiger Strikes whish is a passive, probably because it triggers another spell with the same name that isn't a passive.
Not the biggest issue but just annoying and might require more work.

I'll check the taint log and see what comes up. worst case I'll have to live without it.


Edit:
Seems WoW just instantly taints any global variable in addons.
But as far as I understand my functions need to be global to call them in my XML code?
Or is there some other way to do this.

Last edited by LanceDH : 10-23-15 at 01:09 PM.
  Reply With Quote