typicalzergling / vendor

Vendor WoW Addon
MIT License
4 stars 3 forks source link

NewRule: HasStat() -> Lua Error (functions.lua:225: table index is nill) #52

Closed Sweepi closed 1 year ago

Sweepi commented 3 years ago

Hi,

I want to create a custom rule using the HasStat() function. Unfortunately, the validation always fails with "{path}\rules\functions.lua:225: table index is nill" (Please be aware that line 225 in the released package is not the same line as at github due to stripped debug code)

    -- build a table of the stats this item has
    for st, sv in pairs(GetItemStats(Link)) do
        if (sv ~= 0) then
            itemStats[_G[st]] = true; // <<--- line 225 in the released addon version 5.1.2
        end
    end

I am only using example code given with the HasStat() function: HasStat('haste')

It also does not work when using double quotes, no quotes or backticks instead of the single quotes shown above.

Best regards

typicalzergling commented 1 year ago

This is fixed now.