Nameplate addon causing c-stack overflow
My nameplate addon I use in my Diablo style UI is causing me a few issues. The issue occurs mainly in PVP but I would assume any enviornement where lots of nameplates are created in short periods, or possibly just after a certain amount of been created regardless of how long the period is. I'm not entierly sure, anyhow, the error comes from my function to change the name shown on the nameplate to add the units level and if they are elite/boss/rare to add a symbol tag. Here's the function:
Lua Code:
I'm assuming calling "CompactUnitFrame_UpdateName" that many times is causing the issue, but I don't know of another way to update the name whenever a new nameplate is created. Code:
13x C stack overflow Code:
29x ...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:51: [string "safecall Dispatcher[2]"]:1: chunk has too many syntax levels |
Too exhausted to scold, move hooks outside of hooked events/frames/functions.
Like so, and problem solved(maybe? not tested). Lua Code:
|
Quote:
Quote:
|
If you put the hook somewhere it will be executed more than one time, it's not a good place to put a hook. :P
|
Yeah, I've said that several times now... no hooks inside event handlers, use a hook or an event but not both. I feel like I should be assigning 100 repetitions on the chalkboard after school. >_>
|
Quote:
For example, if I use hooksecurefunc('PlaySound',printsound) with printsound dumping the name of the sound to chat, it will print many uses of UI sounds in the default UI and any addons that use that function for sounds. In your case, WoW is already using the update function for the nameplates, it's better to hook that than rely on the event spam in combat. |
All times are GMT -6. The time now is 08:57 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI