hooksecurefunc works on funcA, but not on funcB - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-04-17, 12:19 AM   #1
A Murloc Raider
Join Date: Aug 2012
Posts: 8
hooksecurefunc works on funcA, but not on funcB

So I'm attempting to add some code to a global function for VuhDo.
Unfortunately I cant seem to figure out why I can hook a func to 'function A', but not to 'function B'

[WORKS] Function A (VuhDo -> VuhDoDebuffs.lua):
function VUHDO_determineDebuff(aUnit)
  --Some code
local VUHDO_determineDebuff = VUHDO_determineDebuff;
[DOESNT WORK] Function B (VuhDo -> VuhDoBarCustomizerHealth.lua):
function VUHDO_customizeText(aButton, aMode, anIsTarget)
  --Some code
local VUHDO_customizeText = VUHDO_customizeText;
My testhook: (hook for function a looks the same)
  local f = CreateFrame("Frame")
  f:SetScript("OnEvent", function(self,event,...)
    if IsAddOnLoaded("VuhDo") then
      hooksecurefunc("VUHDO_customizeText", function() print("This is a test") end)
The hook for function B only seems to work when I comment out the following line:
Note: on function A I dont need to comment out anything. It always works :/
--local VUHDO_customizeText = VUHDO_customizeText;
Can someone help me out on how to debug this issue?
_G["VUHDO_customizeText"] --this exists, can I safely assume its a global function and it should work?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » hooksecurefunc works on funcA, but not on funcB

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off