Fix to table caps being off
Rootkit- opened this issue ยท 1 comments
if string.lower(dest) ~= string.lower(UnitName('player')) and (rules[itemID] or
local function rulesCacheDest(item)
if not item then return end
local rdest
local itemID = type(item) == 'number' and item or tonumber(strmatch(item, "item:(%d+)"))
if not itemID then return end
for _, xID in ipairs(globalExclude.items) do if itemID == xID then return end end
for _, xset in ipairs(globalExclude.pt31Sets) do
if pt:ItemInSet(itemID, xset) == true then return end
end
if select(3, GetItemInfo(itemID)) < self.db.char.minItemLevel then
return nil
end
local itype, isubtype = select(6, GetItemInfo(itemID)) -- old string based lookup
local iclass, isubclass = select(12, GetItemInfo(itemID)) -- new class id based lookup
for dest, rules in pairs(rulesCache) do
local canddest
if string.lower(dest) ~= string.lower(UnitName('player')) and (rules[itemID] or
(rules[itype] and rules[itype][isubtype]) or
(rules[iclass] and rules[iclass][isubclass])) then
canddest = dest
end
if canddest then
local xrules = autoSendRules[canddest].exclude
for _, xID in ipairs(xrules.items) do if itemID == xID then canddest = nil end end
for _, xset in ipairs(xrules.pt31Sets) do
if pt:ItemInSet(itemID, xset) == true then canddest = nil end
end
end
rdest = canddest or rdest
end
return rdest
end