View Single Post
10-26-18, 04:22 PM   #17
Brellison94
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 36
Originally Posted by MuffinManKen View Post
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.
I applied the fix and I am still at the same spot. However, it will now not show me the problem through the Lua Error.
  Reply With Quote