View Single Post
10-17-14, 04:48 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by semlar View Post
Lua Code:
  1. SetSuperTrackedQuestID(0)
  2. hooksecurefunc('SetSuperTrackedQuestID', function(questID) if questID ~= 0 then SetSuperTrackedQuestID(0) end end)
Hooking a function then unwittingly calling it from itself is dangerously close to sending Lua into an infinite loop by recursive calling. You can avoid this by storing the old function and calling that directly instead of calling it normally and running your hook again.
Lua Code:
  1. local oldfunc=SetSuperTrackedQuestID;
  2. hooksecurefunc('SetSuperTrackedQuestID', function() oldfunc(0); end);

Note hooksecurefunc() creates a new function just like any manual hooking method would. The only difference is it bypasses the taint mechanic.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-17-14 at 04:51 PM.
  Reply With Quote