Thread Tools Display Modes
10-26-14, 09:19 AM   #1
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
LUA Error when in raid

I keep getting this error when in a Raid:
Code:
4x [ADDON_ACTION_BLOCKED] AddOn 'BasicUI' tried to call the protected function 'Boss2TargetFrame:Show()'.
!BugGrabber\BugGrabber.lua:586: in function <!BugGrabber\BugGrabber.lua:586>
[C]: in function `Show'
FrameXML\TargetFrame.lua:110: in function `TargetFrame_Update'
FrameXML\TargetFrame.lua:174: in function `OnEvent'
FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>

Locals:
nil
If I disable my Unitframes.lua in game I no longer get the error so something in the coding is the issue.


Here is my Unitframes.lua code.

If you need more code please let me know.

And thanks for any help.

Coke
  Reply With Quote
10-26-14, 09:56 AM   #2
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
you're doing a few things that might well cause taint since the boss frames are pretty sensitive, but I wouldn't be surprised if it was this:

Lua Code:
  1. for i = 1, MAX_BOSS_FRAMES do
  2.     local bossFrame = "Boss"..i.."TargetFrame"
  3.     _G[bossFrame]:SetScale(db.boss.scale)
  4. end

also i realise it's pedantic but would it be easier to do

Lua Code:
  1. local bossFrame = _G["Boss"..i.."TargetFrame"]

instead

edit: also is the boss moving code commented out when you play? Speaking from experience, that'll definitely fuck it up.

Last edited by ObbleYeah : 10-26-14 at 09:59 AM.
  Reply With Quote
10-26-14, 11:01 AM   #3
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by ObbleYeah View Post
you're doing a few things that might well cause taint since the boss frames are pretty sensitive, but I wouldn't be surprised if it was this:

Lua Code:
  1. for i = 1, MAX_BOSS_FRAMES do
  2.     local bossFrame = "Boss"..i.."TargetFrame"
  3.     _G[bossFrame]:SetScale(db.boss.scale)
  4. end
I have done that before and I'm pretty sure it tainted stuff. Only makes sense, anyway.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-26-14, 12:49 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Setting the scale of secure frames wouldn't normally taint them, but overwriting functions like this will..
Lua Code:
  1. PlayerHitIndicator.SetText = function() end
  2. PetHitIndicator.SetText = function() end
The ui calls PlayerHitIndicator:SetText() and everything after that point is now tainted and can't do anything securely.

After looking at the TargetFrameTemplate, setting the scale actually will taint the frame because it has an OnSizeChanged handler which you're inadvertently calling by changing the scale.

Last edited by semlar : 10-26-14 at 12:57 PM.
  Reply With Quote
10-26-14, 01:23 PM   #5
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by semlar View Post
Setting the scale of secure frames wouldn't normally taint them, but overwriting functions like this will..
Lua Code:
  1. PlayerHitIndicator.SetText = function() end
  2. PetHitIndicator.SetText = function() end
The ui calls PlayerHitIndicator:SetText() and everything after that point is now tainted and can't do anything securely.

After looking at the TargetFrameTemplate, setting the scale actually will taint the frame because it has an OnSizeChanged handler which you're inadvertently calling by changing the scale.
So old school TargetFrame:SetScale() no longer works?
  Reply With Quote
10-26-14, 01:55 PM   #6
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I would try doing something like this, to securely scale the frame when it gets shown..
Lua Code:
  1. SecureHandlerWrapScript(Boss1TargetFrame, 'OnShow', Boss1TargetFrame, 'self:SetScale(0.5)')

If you're scaling them in response to a button click, just create a secure frame, pass the frame handles for each boss frame (or other unit frame) into it, and set the scale when the button is clicked.

Last edited by semlar : 10-26-14 at 02:38 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » LUA Error when in raid


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