• 0

    posted a message on GetCursorInfo and pet spells
    Hi, I'm trying to fix a somewhat outdated addon, it uses GetCursorInfo to get the information on the currently draged item. However it seems that dragging a spell from a pet spellbook returns nils.

    eg.
    local linktype, info1, info2 = GetCursorInfo()
    returns nil, nil, nil is the dragged item is a pet spell but returs proper values on normal spells / items.
    Posted in: Lua Code Discussion
  • 0

    posted a message on UNIT_DIED and "other phase" fights
    The annoying thing is that when you check the logs you can see aura fades happenening milliseconds before overkill which leads to believe that blizzard does actually know before-hand when someone dies or the overkill got overhealed.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GetTalentInfo woes
    PLAYER_ALIVE seems to have worked, thanks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GetTalentInfo woes
    I'm trying to find out if the player has a specific talent, however using GetTalentInfo on login returns nil. I also registered PLAYER_TALENT_UPDATE but even when the event fires the info is still nil.

    Mind though that on ui reload there is no such problem, which leads me to believe that GetTalentInfo needs some time to actually produce results after you login.

    By login I mean going out to the character selection screen and then loading the game. Is there some event I should be registering?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Inserting a table into a table.
    Thanks for the answers, not exactly what I was hoping for. But that's how it is, I rewrote the tables to a flat construction seems counter intuitive but works.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Inserting a table into a table.
    I understand the answer, but it isn't very helpuful. Does it mean that that is the way tables work in lua and I can ignore the memory being bloated until the GC runs? (assuming I can't use another data structure)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Inserting a table into a table.
    Hi, I'm having a weird problem. Simplistically what I'm doing is something like that:

    local t = {}
    
    for i = 1, 50, 1 do
      tinsert(t, {i = i, r = i});
      tremove(t, #t);
    end
    


    Now obviously the code is an example, the problem is that if I profile the addon's memory usage it grows every insert/remove untill I'm guessing the GC starts and deletes useless memory blocks.

    Is there any way to avoid it? (I tried first creating the table variable I'm inserting but that doesn't change anything).

    EDIT: obviously if I add a scalar variable instead of a table there is no problem.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.