Unable to setup two statuses for same aura #5


  • Defect
  • Fixed
Closed
Assigned to _ForgeUser117147
  • _ForgeUser1539023 created this issue Feb 18, 2009

    What steps will reproduce the problem?
    1. Setup buff statuses in the SV-file for the same buff, once with mine=true, once with false, e.g. like this:
    ["buffs"] = {
        ["vigilance"] = {
            "Vigilance", -- [1]
            false, -- [2]
            0, -- [3]
            0.6, -- [4]
            0, -- [5]
        },
        ["vigilance-mine"] = {
            "Vigilance", -- [1]
            true, -- [2]
            0, -- [3]
            1, -- [4]
            0, -- [5]
        },
    },

    2. Link an indicator to these statuses, e.g:
    ["buffs"] = {
        ["corner-bottomleft"] = {
            ["buff-vigilance-mine"] = 99,
            ["buff-vigilance"] = 80,
        },
    },

    3. Load Grid2

    What is the expected output? What do you see instead?
    I would expect to see the color of the indicator whether the buff was cast by me or by someone else. Instead I get an error.

    What version of the product are you using?
    r48

    Do you have an error log of what happened?
    Message: ..\AddOns\Grid2\GridStatus.lua line 62:
       assertion failed!
    Debug:
       (tail call): ?
       [C]: assert()
       Grid2\GridStatus.lua:62: RegisterStatus()
       Grid2\GridDefaults.lua:181: SetupAuraStatus()
       Grid2\GridDefaults.lua:227: Setup()
    ...

    Please provide any additional information below.
    Maybe it is not intended to setup statuses like that, but I would like to have them this way and the problem is easily fixed.
    In GridDefaults.lua the status creation starts with:

    function Grid2:SetupAuraStatus(setup)
        for name, info in pairs(setup.buffs ) do
            local name, mine = info[1], info[2]
            local status = self:CreateBuffStatus(name, mine)
            status.name = "buff-"..name -- force name

    One can see that inside the for loop, the loop-variable name is shadowed by another local variable. If one of these variables gets renamed, i.e. like this:

        for statusname, info in pairs(setup.buffs ) do
            local name, mine = info[1], info[2]
            local status = self:CreateBuffStatus(name, mine)
            status.name = "buff-"..statusname -- force name

    the above setup works to my satisfaction.

  • _ForgeUser1539023 added the tags New Defect Feb 18, 2009
  • _ForgeUser117147 posted a comment Feb 19, 2009

    Fixed in Revision 50

    Thanks.

  • _ForgeUser117147 removed a tag New Feb 19, 2009
  • _ForgeUser117147 added a tag Fixed Feb 19, 2009
  • _ForgeUser117147 closed issue Feb 19, 2009

To post a comment, please login or register a new account.