klingo / ESO-PersonalAssistant

PersonalAssistant, an Addon for 'The Elder Scrolls Online'
zlib License
19 stars 8 forks source link

PAJunk.lua issue with itemQuality and operator #372

Closed ditolesto closed 3 years ago

ditolesto commented 3 years ago

When AutoJunk is enabled, and the code detects there is a junk decision to be made on item quality, the addon has an issue at line 461 of PAjunk.lua:

local qualityThreshold = savedVarsGroup.autoMarkQualityThreshold
-->        if qualityThreshold ~= PAC.ITEM_QUALITY.DISABLED and itemQuality <= qualityThreshold then

and the error code states that operator < is not supported for number < string.

I think this means that when there is the decision to be made based on item quality, we are comparing a string against a number and that fails.

In the screenshot the variables itemQuality = 1 and qualityThreshold = Normal

personalassistanterror

ditolesto commented 3 years ago

I ended up modifying PAJunkMenuDefaults.lua, and set the autoMarkQualityThreshold parameter to 1 (Normal) and that set the default threshold for the category, so i didn't need to use the dropdown.

The mapping of the itemQuality number and the String version of the dropdown is broken.

Unfortunately i wasn't able to trace how to make sure this mapping is correct, so ended up modifying the default instead.

klingo commented 3 years ago

Your analysis is correct, although it should not happen that the string representation of the quality level is stored in the SavedVariables - it should always use the numeric representation (which works fine).

Unfortuantely, I'm not sure what I can do here, since I don't really see in the code how this wrong assignment could have happened :( Please let me know though if this should happen again, even after your manual fix.

FLY1NGSQU1RR3L commented 3 years ago

@klingo - is the PAJSavedVars table being shared across multiple of your mods? Maybe there's a copy/paste error somewhere that is updating your table with a string from outside? I don't see where the error is being introduced here either, but I'm not familiar enough with how to step through this while running the mod in-game yet. Just started looking today after I hit the same error.

If you had a sec to just point me to when the table gets created to when it gets patched maybe we can help you find this bug.

image