I don't really know how to explain this, but I am trying to fix an addon that allows either all units or a specified list of units. The all units part is working fine however when specific units are selected nothing is output to the game. There is no error it just does nothing.
From the addon
Code:
local function UnitisAllowed(unit)
for key, val in pairs(addon.CONFIG.units) do
if UnitIsUnit(unit, val) then return true end
end
return false
end
Code:
if eventType == "SPELL_AURA_APPLIED" and addon.BUFF_SPELLS[spellname] and isEnemy(destFlags) and (addon.CONFIG.allunits or UnitisAllowed(destName)) then
from the config
Code:
addon.CONFIG = {
allunits = false,
units = {
"target",
"focus",
},
}
Am I using the correct syntax for the check? I'm just not sure why it is failing.