Luxocracy / NeatPlates

NeatPlates is a continuation of the original Tidy Plates in an attempt to keep it update date in the absence of its authors.
https://wow.curseforge.com/projects/neat-plates
80 stars 20 forks source link

Error with Enabled Interact Key (softtarget) #356

Open Dairyman opened 1 year ago

Dairyman commented 1 year ago

What version of the game you are experiencing the issue with: Beta (Dragonflight, Build: 46144), NeatPlates v418-alpha2

Describe the bug When the interaction icon are enabled and set to all. Standing by a Mailbox will throw an error.

To Reproduce Steps to reproduce the behavior:

  1. Enable Interact Key in Gameplay>Controls
  2. Set Interaction Key Icon to all in Accessibility>General
  3. Go near a Mailbox
  4. Get error

Expected behavior No error

Error

422x Interface/AddOns/NeatPlatesHub/functions/Color.lua:209: Division by zero
[string "@Interface/AddOns/NeatPlatesHub/functions/Color.lua"]:209: in function <Interface/AddOns/NeatPlatesHub/functions/Color.lua:206>
[string "@Interface/AddOns/NeatPlatesHub/functions/Color.lua"]:279: in function `SetHealthbarColor'
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:1214: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:1211>
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:1295: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:1276>
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:691: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:662>
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:807: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:797>
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:377: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:350>

Locals:
unit = <table> {
 guid = "GameObject-0-2084-2222-10752-353521-00005324A2"
 isMouseover = false
 class = ""
 rawName = "Bank"
 level = 0
 red = 0
 powermax = 0
 isDangerous = false
 isPet = false
 name = "Bank"
 levelcolorBlue = 0.500000
 isMarked = false
 isBoss = false
 levelcolorRed = 0.500000
 isFocus = false
 healthmax = 0
 isTarget = false
 levelcolorGreen = 0.500000
 style = "NameOnly"
 alphaMult = 0.254902
 isTapped = false
 type = "NPC"
 blue = 1
 power = 0
 isInCombat = false
 threatSituation = "LOW"
 isTrivial = true
 health = 0
 showName = true
 reaction = "FRIENDLY"
 green = 0
 isCasting = false
 threatValue = 0
 isMini = false
 unitid = "nameplate3"
}
color = nil
aura = nil
threshold = nil
current = nil
lowest = nil
(*temporary) = 0
(*temporary) = 0
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "Division by zero"
LocalVars = <table> {
 TextShowOnlyOnActive = false
 WidgetAuraSort = 1
 WidgetResourceDisplayTimer = true
 UnitSpotlightLookup = <table> {
 }
 EnableOffTankHighlight = false
 StyleShowEnemyPowerBar = false
 SpellCastEnableFriendly = false
 WidgetResourceTimerFontSize = 8
 StyleEnemyBarsInstanceMode = false
 EmphasizedAuraScale = 2
 ColorSchoolHoly = <table> {
 }
 FriendlyNameColorMode = "Default"
 HighlightMouseoverScale = <table> {
 }
 OpacityNonTarget = 0.500000
 StyleEnemyBarsOnElite = true
 StyleEnemyBarsNoTotem = false
 OpacitySpotlightSpellInt = false
 IntCastWhoEnable = true
 UnitSpotlightColor = <table> {
 }
 StyleEnemyBarsClickThrough = false
 StyleFriendlyBarsClickThrough = false
 DefaultEnemyNameplatesOnNPCs = false
 StatusTextRight = 7
 StyleFriendlyBarsOnPlayers = true
 DefaultFriendlyNameplatesOnNPCs = false
 WidgetAuraTrackCurse = true
 ColorSchoolFrost = <table> {
 }
 WidgetQuestIcon = false
 StatusTextCenterColor = true
 ColorBuffPurgeable = <table> {
 }
 HighlightTargetMode = 1
 WidgetBuffFilter = 1
 WidgetBuffPurgeable = false
 WidgetThreatIndicator = true
 HeadlineEnemyColor = 4
 WidgetAuraScaleOptions = <table> {
 }
 ColorRangeClose = <table> {
 }
 StyleFriendlyBarsInstanceMode = false
 ColorHostilePlayer = <table> {
 }
 OpacityFilterMini = false
 StatusTextRightColor = true
 FriendlyStatusTextMode = "HealthFunctionNone"
 OpacityFilterFriendlyPlayers = false
 UnitSpotlightOpacity = 1
 StyleFriendlyBarsOnElite = false
 CastBarWidth = 1
 StyleFriendlyBarsOnActive = true
 FriendlyBarColorMode = "ByReaction"
 TextStatusForceShadow = false
 StyleHeadlineOutOfCombat = false
 AltShortening = false
 TextColorPartyMember = <table> {
 }
 DefaultFriendlyNameplatesOnPlayers = false
 UnitSpotlightGlowEnable = true
 WidgetAuraTrackDisease = true
 StyleForceBarsOnTargets = false
 ColorMouseover = <table> {
 }
 WidgetDebuff = true
 TextHealthPercentPrecision = 0
 TextUseBlizzardFont = false
 ColorPartyAggroText = false
 ColorSchoolShadow = <table> {
 }
 ScaleFiltered = 0.800000
 ScaleTargetSpotlight = false
 OpacitySpotlightMouseover = false
 OpacityFilterInactive = false
 WidgetRangeUnits = 2
 StyleEnemyBarsOnNPC = true
 WidgetResourceStyle = "Neat"
 DefaultNeutralNameplatesOnNPCs = false
 StyleFriendlyMode = 2
 AdvancedEnableUnitCache = true
 FriendlySubtextColor = <table> {
 }
 HighlightMouseoverMode = 1
 OpacityFilterNeutralUnits = false
 TextColorFriendlyNPC = <table> {
 }
 OpacityFilterEnemyNPC = false
 TextNameColorMode = 1
 EnemySubtextColor = <table> {
 }
 ClassEnemyIcon = false
 OpacityTarget = 1
 TextColorHostilePlayer = <table> {
 }
 WidgetAuraTrackPoison = true
 WidgetTotemIcon = false
 ColorTapped = <table> {
 }
 SpellCastEnableEnemy = true
 WidgetAbsorbMode = 1
 TextHealthTextMode = 1
 WidgetRangeScale = false
 WidgetAuraTrackDispelFriendly = false
 ColorFriendlyPlayer = <table> {
 }
 ColorPartyAggroGlow = true
 ScaleSpotlightMode = 2
 WidgetEliteIndicator = true
 IntCastEnable = true
 AuraScale = 1
 WidgetArenaIcon = false
 FriendlyHeadlineColor = "ByReaction"
 EnemyHeadlineColor = "ByReaction"
 ScaleS
Luxocracy commented 1 year ago

I wasn't able to replicate the error on the PTR, as I don't have access to the Beta. But I did make a small change to the latest alpha release that should hopefully resolve this issue even in the Beta.

Dairyman commented 1 year ago

The change didn't fix it.

Changing it to works:

unit.healthmax = unit.healthmax == 0 and 1 or unit.healthmax

Note that 0is true in Lua, only falseand nilare false.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 90 days with no activity. If you feel the issue is still relevant, please leave a comment to prevent the issue from being closed in 30 days