View Single Post
10-26-18, 02:24 PM   #16
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
There is also another bug that I saw. I don't know if it's related, but the bug is also in AudioX. Both addons override SetItemRef and do it incorrectly.

BossTalk.SetItemRef(link, text, button) take 3 parameters and if it isn't a BossTalk link, passes them on to Blizzard's: BossTalk.SetItemRef_Original(link, text, button);

But that isn't actually Blizzard's, because AudioX is overwriting it too, and if the link isn't one it's interested in, it passes it on to (probably) Blizzard's:
SetItemRef_orig(link,text,button)

Unfortunately, Blizzard's function looks like this:
function SetItemRef(link, text, button, chatFrame)

The chatFrame parameter is being thrown away. And overwriting the function like that is dangerous and can mess up other addons or even the entire system. You should change:
BossTalk.SetItemRef_Original = SetItemRef
SetItemRef = BossTalk.SetItemRef
to:
hooksecurefunc("SetItemRef", BossTalk.SetItemRef)

and then you can remove BossTalk.SetItemRef_Original completely. It's no longer needed since the original code will be automatically called first and then yours will be. AudioX has the same issue and should be fixed in the same way.
  Reply With Quote