Quantcast Getting error spammed from a small addon. Can anyone help? - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-20-15, 10:50 PM   #1
Lesteryoung
A Cliff Giant
Join Date: Aug 2015
Posts: 76
Getting error spammed from a small addon. Can anyone help?

Aforementioned error:

1x Tweaks\UnitColor.lua:10: attempt to index global 'c' (a nil value)
Tweaks\UnitColor.lua:10: in function <Tweaks\UnitColor.lua:7>
[C]: in function `TargetUnit'
FrameXML\SecureTemplates.lua:513: in function `handler'
FrameXML\SecureTemplates.lua:649: in function `SecureActionButton_OnClick'
FrameXML\SecureTemplates.lua:689: in function <FrameXML\SecureTemplates.lua:681>

Locals:
(*temporary) = "raid29"
(*temporary) = "PLAYER_TARGET_CHANGED"
(*temporary) = "PLAYER_TARGET_CHANGED"
(*temporary) = <function> defined =[C]:-1

This is the addon:

Code:
local frame = CreateFrame("FRAME")
frame:RegisterEvent("GROUP_ROSTER_UPDATE")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
frame:RegisterEvent("UNIT_FACTION")

local function eventHandler(self, event, ...)
        if UnitIsPlayer("target") then
                c = RAID_CLASS_COLORS[select(2, UnitClass("target"))]
                TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
        end
        if UnitIsPlayer("focus") then
                c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
                FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
        end
end

frame:SetScript("OnEvent", eventHandler)

for _, BarTextures in pairs({TargetFrameNameBackground, FocusFrameNameBackground}) do
        BarTextures:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Getting error spammed from a small addon. Can anyone help?

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