Having a small error with my latest rework
Code:
[07:25:36] Interface\AddOns\oUF\ouf.lua:523: bad argument #1 to 'select' (index out of range)
[C]: ?
[C]: ?
Interface\AddOns\oUF\ouf.lua:523: in function `ColorGradient'
Interface\AddOns\oUF_AI\oUF_AI.lua:263: in function <Interface\AddOns\oUF_AI\oUF_AI.lua:227>
Interface\AddOns\oUF_HealComm4\oUF_HealComm4.lua:166: in function `PostUpdateHealth'
Interface\AddOns\oUF\elements\health.lua:98: in function `UNIT_MAXHEALTH'
Interface\AddOns\oUF\elements\health.lua:43: in function <Interface\AddOns\oUF\elements\health.lua:36>
what is going wrong everything seems to wotk fine
in ouf_AI
Code:
local function PostUpdateHealth(self, event, unit, bar, min, max) --LINE 227
if(UnitIsDead(unit)) then
bar.value:SetText('Dead')
elseif(UnitIsGhost(unit)) then
bar.value:SetText('Ghost')
elseif(not UnitIsConnected(unit)) then
bar:SetValue(0)
bar.value:SetText('Offline')
else
if(min~=max) then
local r, g, b
r, g, b = oUF.ColorGradient(min/max, unpack(oUF.colors.smooth))
if(unit=='player' or unit=='pet') then
bar.value:SetFormattedText('%d (|cff%02x%02x%02x%d|r%%)', (min), r*255, g*255, b*255, (min/max)*100)
elseif(unit=='target' or unit=='focus') then
bar.value:SetFormattedText('%s (|cff%02x%02x%02x%.1f|r%%)', letter(min), r*255, g*255, b*255, (min/max)*100)
elseif(self:GetParent():GetName():match'oUF_Raid') then
bar.value:SetFormattedText('|cffff8080%s|r', rletter(min-max))
else
bar.value:SetFormattedText('|cffff8080%s|r', letter(min-max))
end
else
if(unit=='player' or unit=='pet') then
bar.value:SetFormattedText('%s', (max))
elseif(unit=='target' or unit=='focus') then
bar.value:SetFormattedText('%s', letter(max))
else
bar.value:SetText('')
end
end
end
if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsPlayer(unit)) then
bar:SetStatusBarColor(0.7,0.7,0.7)
else
local r, g, b = oUF.ColorGradient(min/max, unpack(oUF.colors.smooth))--LINE 263
bar:SetStatusBarColor(r, g, b)
end
self:UNIT_NAME_UPDATE(event, unit)
end