Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VuhDo VuhDo
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 279
    • Issues 279
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • VuhDo
  • VuhDoVuhDo
  • Issues
  • #678

Closed
Open
Created Jan 17, 2023 by ramblin-rose@ayze-atiesh

VUHDO_customizeHotIcons repeatedly raises "bad argument #5 to '?' (Usage: self:SetVertexColor(color [, a]))"

VuhDo version

3.145-wotlkc

World of Warcraft region

Americas

World of Warcraft client language

enUS

Summary of the issue:

I noticed the Power Word: Shield, Weakened Soul indicators were not working (no state change). BugSack shows an enormous number of errors, I presume this code is invoked via a frame update handler.

Error Stack

19757x bad argument #5 to '?' (Usage: self:SetVertexColor(color [, a])) [string "=[C]"]: in function `SetVertexColor' [string "@VuhDo/VuhDoBarCustomizerHots.lua"]:342: in function <VuhDo/VuhDoBarCustomizerHots.lua:198> [string "@VuhDo/VuhDoBarCustomizerHots.lua"]:392: in function <VuhDo/VuhDoBarCustomizerHots.lua:368> [string "@VuhDo/VuhDoBarCustomizerHots.lua"]:640: in function <VuhDo/VuhDoBarCustomizerHots.lua:509> [string "@VuhDo/VuhDoBarCustomizerHots.lua"]:730: in function <VuhDo/VuhDoBarCustomizerHots.lua:725> [string "@VuhDo/VuhDoEventHandler.lua"]:1391: in function <VuhDo/VuhDoEventHandler.lua:1303> Locals: (*temporary) = "bad argument #5 to '?' (Usage: self:SetVertexColor(color [, a]))"

The Offending Code

Line 342:

tIcon:SetVertexColor(tHotColor["R"], tHotColor["G"], tHotColor["B"], tIsChargeAlpha and tHotColor["O"]);

The expression tIsChargeAlpha and tHotColor["O"] is the problem. If tIsChargeAlpha is true then the expression resolves to tHotColor["O"]. If tIsChargeAlpha is false, then the expressions resolves to false, and the error is raised.

The alpha value should be in [0,1] or nil.

This solves the immediate problem by forcing the expression to always resolve to tHotColor["O"] or 0:

tIcon:SetVertexColor(tHotColor["R"], tHotColor["G"], tHotColor["B"], (tIsChargeAlpha and 1 or 0) and tHotColor["O"]);

However I don't know the intent of tIsChargeAlpha, e.g. should alpha be nil if tIsChargeAlpha is false? Thus whether this is a legitimate fix is unknown.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking