Thread Tools Display Modes
10-22-19, 01:22 PM   #1
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Taint Classic

Can someone please tell me why this script gives error below:

Code:
10x [ADDON_ACTION_BLOCKED] AddOn 'xVerminz' tried to call the protected function 'TargetFrameToT:Show()'.
!BugGrabber\BugGrabber.lua:519: in function <!BugGrabber\BugGrabber.lua:519>
[C]: in function `Show'
FrameXML\TargetFrame.lua:910: in function <FrameXML\TargetFrame.lua:905>
[C]: in function `TargetofTarget_Update'
FrameXML\TargetFrame.lua:420: in function `TargetFrame_OnUpdate'
[string "*:OnUpdate"]:1: in function <[string "*:OnUpdate"]:1>

Locals:
InCombatSkipped
Code:
-------------------------------------------
-- ADD BORDER TO BUFFS AND DEBUFFS ON TARGET FRAME
-------------------------------------------

DebuffTypeColor = { };
DebuffTypeColor["none"]		= { r = 0.80, g = 0, b = 0 };
DebuffTypeColor["Magic"]	= { r = 0.20, g = 0.60, b = 1.00 };
DebuffTypeColor["Curse"]	= { r = 0.60, g = 0.00, b = 1.00 };
DebuffTypeColor["Disease"]	= { r = 0.60, g = 0.40, b = 0 };
DebuffTypeColor["Poison"]	= { r = 0.00, g = 0.60, b = 0 };
DebuffTypeColor[""]			= DebuffTypeColor["none"];

borderBuff = "Interface\\AddOns\\xVerminz\\media\\textureOverlay"
borderDebuff = "Interface\\AddOns\\xVerminz\\media\\textureDebuff"
font = "Interface\\AddOns\\xVerminz\\media\\fontAtari.ttf"

local function SkinTarget()
	if TargetFrame:IsShown() then
		numBuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitBuff("target", i)) ) then
				numBuffs = numBuffs + 1
			end
		end

		numDebuffs = 0
		for i=1, MAX_TARGET_DEBUFFS do
			if( select(3, UnitDebuff("target", i)) ) then
				numDebuffs = numDebuffs + 1
			end
		end
		
		for i=1, numBuffs do
			local frame = _G["TargetFrameBuff"..i]
			local frameBorder = _G["TargetFrameBuff"..i.."Border"];
			local frameCount = _G["TargetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(6)
				frame:SetBeautyBorderTexture(borderBuff)
				frame:SetScale(1.3);
			end
		end

		for i=1, numDebuffs do
			local frame = _G["TargetFrameDebuff"..i]
			local frameBorder = _G["TargetFrameDebuff"..i.."Border"];
			local frameCount = _G["TargetFrameDebuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end

			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if ( select(4, UnitDebuff("target", i)) ) then
				color = DebuffTypeColor[select(4, UnitDebuff("target", i))];
			else
				color = DebuffTypeColor["none"];
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(6)
				frame:SetBeautyBorderTexture(borderDebuff)
				frame:SetBeautyBorderColor(color.r, color.g, color.b)
				frame:SetScale(1.3);
			end
		end
	end
end

local function SkinPet()
	if PetFrame:IsShown() then
		numBuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitBuff("pet", i)) ) then
				numBuffs = numBuffs + 1
			end
		end

		numDebuffs = 0
		for i=1, MAX_TARGET_BUFFS do
			if( select(3, UnitDebuff("pet", i)) ) then
				numDebuffs = numDebuffs + 1
			end
		end
		
		for i=1, numBuffs do
			local frame = _G["PetFrameBuff"..i]
			local frameBorder = _G["PetFrameBuff"..i.."Border"];
			local frameCount = _G["PetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(4)
				frame:SetBeautyBorderTexture(borderBuff)
			end
		end

		for i=1, numDebuffs do
			local frame = _G["PetFrameDebuff"..i]
			local frameBorder = _G["PetFrameDebuff"..i.."Border"];
			local frameCount = _G["PetFrameBuff"..i.."Count"];
			if (frameBorder~=nil) then frameBorder:Hide() end
			
			if (frameCount~=nil) then
				frameCount:SetFont(font, 10, 'THINOUTLINE')
				frameCount:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 2)
			end

			if ( select(4, UnitDebuff("pet", i)) ) then
				color = DebuffTypeColor[select(4, UnitDebuff("target", i))];
			else
				color = DebuffTypeColor["none"];
			end

			if (frame~=nil) then
				frame:CreateBeautyBorder(4)
				frame:SetBeautyBorderTexture(borderDebuff)
				frame:SetBeautyBorderColor(color.r, color.g, color.b)
			end
		end
	end
end

local function SkinFocus()
	-- if FocusFrame:IsShown() then
	-- 	numDebuffs = 0
	-- 	for i=1, MAX_FOCUS_DEBUFFS do
	-- 		if( select(3, UnitDebuff("focus", i)) ) then
	-- 			numDebuffs = numDebuffs + 1
	-- 		end
	-- 	end
	
	-- 	for i=1, numDebuffs do
	-- 		local frame = _G["FocusFrameDebuff"..i]
	-- 		-- frame:Hide()
	-- 		frame:SetScale(1.2);
	-- 		frame:CreateBeautyBorder(4)
	--   	end
	-- end
end

hooksecurefunc("TargetFrame_UpdateAuras", SkinTarget)
hooksecurefunc("PlayerFrame_Update", SkinPet)
  Reply With Quote
10-22-19, 01:56 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
I see at least 4 variables that are not local.
  1. DebuffTypeColor
  2. borderBuff
  3. numBuffs
  4. color

Run your code through this application: https://www.wowinterface.com/downloa...OTANADDON.html

Last edited by myrroddin : 10-22-19 at 01:59 PM. Reason: provide link to WoW Global Finder
  Reply With Quote
10-22-19, 03:58 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
What you're doing to DebuffTypeColor is causing the taint. That is Blizzard's table and the very first line of your code is basically deleting it. Changing the values could also taint it. An example of this is the blue shaman addon, which touches the RAID_CLASS_COLORS table, which taints all the raid frames.
  Reply With Quote
10-23-19, 05:08 AM   #4
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Thank you ...

I just have no explanation why i left half of them not local ... except i am noob obviously.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Taint Classic

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