t-mart / ItemVersion

ItemVersion adds information to your tooltip about when an item was added to World of Warcraft.
https://www.curseforge.com/wow/addons/itemversion
GNU General Public License v3.0
9 stars 8 forks source link

Error while talking to enchanting trainer #2

Closed arnvid closed 3 years ago

arnvid commented 3 years ago

Description

Error came while buying new skills at the vendor.

Steps to Reproduce

  1. Just buying new skills
x33  ItemVersion\Tooltip.lua:16: bad argument #1 to 'strmatch' (string expected, got nil)
Stack: [string "=[C]"]: in function 'strmatch'
[string "@ItemVersion\Tooltip.lua"]:16: in function <ItemVersion\Tooltip.lua:14>
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: in function 'SetTrainerService'
[string "*:OnEnter"]:3: in function <[string "*:OnEnter"]:1>
Time: 2021/01/12 11:39:00 Index: 3/3
Locals:
(*temporary) = nil
(*temporary) = ":(%w+)"
(*temporary) = "string expected, got nil"
t-mart commented 3 years ago

Thanks for reporting this, @arnvid!

I was able to reproduce the error. I believe that the error comes from trying to lookup the spell id that crafts the item (example), not the item id of the resulting item (example). Spell ids and item ids are separate concepts, so one may not be used to get the other.

This addon only hooks into item tooltips, so I guess in this instance at the training vendor, the game is doing something funny by overloading item tooltip to display a spell.

I don't think its appropriate to be displaying item version info on a spell tooltip, so I will most likely prevent ItemVersion from adding anything to the tooltip in these cases.

At the very least, I will work on removing this lua error.

t-mart commented 3 years ago

Should be fixed @arnvid in 2021.2.1. Has been released to CurseForge too.

Let me know if you still encounter the issue.

arnvid commented 3 years ago

@t-mart great news.. have just installed the update and will keep and eye out for this or anything else.