typicalzergling / vendor

Vendor WoW Addon
MIT License
4 stars 3 forks source link

Tooltip scanning not working properly? #43

Closed stornquist closed 3 years ago

stornquist commented 3 years ago

this is the function i use for keeping garrison related stuff (like miner's coffee)

TooltipContains("Garrison") or TooltipContains("garrison") or Name == "Miner's Coffee"

I had to explicitly set the last one because even though the tooltip of the item has garrison in it it will still sell the miner's coffee

stornquist commented 3 years ago

Getting this error from time to time as well now

Message: Interface\AddOns\Vendor\ui\tooltip.lua:98: attempt to compare number with table
Time: Mon Oct 19 01:12:41 2020
Count: 4
Stack: Interface\AddOns\Vendor\ui\tooltip.lua:98: attempt to compare number with table
[string "@Interface\AddOns\Vendor\ui\tooltip.lua"]:98: in function `AddItemTooltipLines'
[string "@Interface\AddOns\Vendor\ui\tooltip.lua"]:36: in function `?'
[string "@Interface\AddOns\Vendor\sys\hook.lua"]:42: in function <Interface\AddOns\Vendor\sys\hook.lua:42>
[string "@Interface\AddOns\Vendor\sys\hook.lua"]:52: in function <Interface\AddOns\Vendor\sys\hook.lua:50>
typicalzergling commented 3 years ago

I found the problem. I suspect it is taint from another addon because we were not using a local variable for "result" so I believe it is possible that some other addon is using the global variable 'result' and ours is getting overridden. Easy fix, should be up soon.

typicalzergling commented 3 years ago

Fixed in 4.1.4

typicalzergling commented 3 years ago

Got the two issues mixed up since the same tooltip error was mentioned in both. I fixed the 'number with table' bug.

Playing with tooltip scanning. It's odd, because the text for the on use words are definitely present.

typicalzergling commented 3 years ago

I found a stale cache issue which I believe is to blame for this. I've since fixed it in 4.1.5, when that is available, please check against that.

I was able to get TooltipContains("garrison") to match Miner's Coffee (and Primal Spirit, for what its worth). Though I'd recommend you just add this to the always-keep list, as that's far more efficient than a tooltip scan, performance wise.