Thread Tools Display Modes
04-13-18, 07:53 AM   #1
Cie
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 2
c stack overflow (moving ComboPointPlayerFrame)

Hi,

im moving the Rogue Combo Point Bar like this:

Lua Code:
  1. local function yOffset(Frame,y)
  2.     local P = { Frame:GetPoint() }
  3.     Frame:SetPoint(P[1], P[2], P[3], P[4],y)
  4. end
  5.  
  6. hooksecurefunc(ComboPointPlayerFrame,"SetPoint",function(ComboPointPlayerFrame) yOffset(ComboPointPlayerFrame,91) end)

however i get the following error:

Code:
Message: C stack overflow
Time: 04/13/18 15:51:24
Count: 1
Stack: C stack overflow
[C]: ?
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
.lua:87: in function <...lua:6>
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
.lua:87: in function <...lua:6>
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
.lua:87: in function <...lua:6>
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
...
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
.lua:87: in function <...lua:6>
[C]: in function `SetPoint'
.lua:84: in function <...lua:1>
.lua:87: in function <...lua:6>
[C]: in function `SetPoint'
Interface\FrameXML\ComboFramePlayer.lua:35: in function `Setup'
Interface\FrameXML\ClassPowerBar.lua:56: in function `OnEvent'
Interface\FrameXML\ComboFramePlayer.lua:27: in function <Interface\FrameXML\ComboFramePlayer.lua:21>
its working fine though, but i cant fix it, whats the exact problem here?

Last edited by Cie : 04-13-18 at 07:58 AM.
  Reply With Quote
04-13-18, 08:14 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
It’s recursive. You attached a function that calls SetPoint to SetPoint itself. Find another function to hook to.
  Reply With Quote
04-13-18, 09:01 AM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Yep. You are using SetPoint on each pixel of the y axis (same would be true if you also did it on the x axis). Try setting the frame to movable and moving or sizing. Once the frame has stopped moving, then GetPoint for the new position and save that to your SVs.
  Reply With Quote
04-13-18, 04:49 PM   #4
Kakjens
A Cliff Giant
Join Date: Apr 2017
Posts: 75
Shouldn't this work:
Lua Code:
  1. local needs_to_setpoint = true
  2. local function yOffset(Frame,y)
  3.     if needs_to_setpoint
  4.         needs_to_setpoint = false
  5.         local P = { Frame:GetPoint() }
  6.         Frame:SetPoint(P[1], P[2], P[3], P[4],y)
  7.     end
  8.     needs_to_setpoint = true
  9. end
  10.  
  11. hooksecurefunc(ComboPointPlayerFrame,"SetPoint",function(ComboPointPlayerFrame) yOffset(ComboPointPlayerFrame,91) end)
?
  Reply With Quote
04-13-18, 11:09 PM   #5
Cie
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 2
i just anchored it to the playerframe , didnt worked the first time ive tried it , but it does now. well
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » c stack overflow (moving ComboPointPlayerFrame)

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