LunaUnitFrames

LunaUnitFrames

268k Downloads

Lua errors from [ssmarthealth] tag when targeting a mind controlled NPC

213983770 opened this issue ยท 1 comments

commented

This error happens when a horde priest has mind controlled field Field Marshal Afrasiabi and I have the NPC targeted on an alliance character.

Version: 3.045 Beta

Problem seems to be in [ssmarthealth] tag where maxhp is a string and gets compared to 1.

local maxhp = UnitHealthMax(unit)
if maxhp > 1000 then
maxhp = (math.floor(maxhp/100)/10).."K"
end
if UnitIsGhost(unit) then
return L["Ghost"]
elseif not UnitIsConnected(unit) then
return L["Offline"]
elseif not UnitHasHealthData(unit) then
if maxhp < 1 then

Time: Mon Mar  2 19:55:07 2020
Count: 480
Stack: Interface\AddOns\LunaUnitFrames\modules\tags.lua:317: attempt to compare string with number
Interface\AddOns\LunaUnitFrames\modules\tags.lua:317: in function `?'
Interface\AddOns\LunaUnitFrames\modules\tags.lua:897: in function <Interface\AddOns\LunaUnitFrames\modules\tags.lua:887>

Locals: frame = LUFUnittarget {
 0 = <userdata>
 OnLeave = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:532
 UnregisterAll = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:137
 isDead = false
 auras = <unnamed> {
 }
 castBar = <unnamed> {
 }
 registeredEvents = <table> {
 }
 UnitClassToken = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:544
 powerBar = <unnamed> {
 }
 RegisterNormalEvent = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:59
 topFrameLevel = 5
 RegisterUpdateFunc = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:110
 SetBlockColor = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:183
 unitType = "target"
 SetRangeAlpha = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:171
 visibility = <table> {
 }
 CheckModules = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:253
 highlight = <unnamed> {
 }
 incomingHeal = 0
 unitInitialized = true
 unitRealType = "target"
 unit = "target"
 ReregisterUnitEvents = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:38
 unitGUID = "Creature-0-4468-0-70-14721-00005AC2A5"
 hasStateWatch = false
 RegisterUnitEvent = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:104
 tagUpdate = <unnamed> {
 }
 fontstrings = <table> {
 }
 borders = <unnamed> {
 }
 UpdateCastBar = <function> defined @Interface\AddOns\LunaUnitFrames\modules\cast.lua:21
 healthBar = <unnamed> {
 }
 highFrame = <unnamed> {
 }
 UnregisterSingleEvent = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:87
 DisableRangeAlpha = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:163
 OnEnter = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:518
 fullUpdates = <table> {
 }
 UnregisterUpdateFunc = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:127
 indicators = <unnamed> {
 }
 BlizzRegisterUnitEvent = <function> defined =[C]:-1
 incHeal = <unnamed> {
 }
 FullUpdate = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:30
 isUnitVolatile = true
 SetBarColor = <function> defined @Interface\AddOns\LunaUnitFrames\modules\units.lua:179
}
unit = "target"
hp = "3.1K"
maxhp = "51.7K"
(*temporary) = false
(*temporary) = "target"
(*temporary) = false
(*temporary) = "attempt to compare string with number"
UnitHealth = <function> defined =[C]:-1
feigncheck = <function> defined @Interface\AddOns\LunaUnitFrames\modules\tags.lua:42
L = <table> {
 Weaponbuffs = "Weaponbuffs"
 Set the buffsize. = "Set the buffsize."
 The space between each column = "The space between each column"
 Highlight the frames borders when the unit is moused over = "Highlight the frames borders when the unit is moused over"
 Xp bar = "Xp bar"
 Dead = "Dead"
 The maximum amount of columns = "The maximum amount of columns"
 elitedesc = ""elite" if the creature is elite or rareelite"
 Own buff/debuff = "Own buff/debuff"
 Tags = "Tags"
 Aggro = "Aggro"
 Never = "Never"
 Alpha = "Alpha"
 Where a new column is started = "Where a new column is started"
 Down = "Down"
 Combo points = "Combo points"
 Health bar = "Health bar"
 Cast bar = "Cast bar"
 elite = "elite"
 Reckoning Stacks = "Reckoning Stacks"
 raredesc = ""rare" if the creature is rare or rareelite"
 raid = "Raid"
 Power Type = "Power Type"
 Size = "Size"
 Ascending = "Ascending"
 perpp = "Mana/rage/energy percent"
 Health percent = "Health percent"
 Since mana/energy rege```
commented

Fixed in #659