CraftSim

CraftSim

2M Downloads

Tailoring: Error when filtering to previous expansion patterns

sehra opened this issue ยท 6 comments

commented
Message: Interface/AddOns/CraftSim/Data/Classes/NodeData.lua:31: attempt to index local 'nodeInfo' (a nil value)
Time: Thu Mar  9 12:52:31 2023
Count: 1
Stack: Interface/AddOns/CraftSim/Data/Classes/NodeData.lua:31: attempt to index local 'nodeInfo' (a nil value)
[string "=[C]"]: ?
[string "@Interface/AddOns/CraftSim/Data/Classes/NodeData.lua"]:31: in function `new'
[string "@Interface/AddOns/CraftSim/Libs/classic.lua"]:66: in function `NodeData'
[string "@Interface/AddOns/CraftSim/Data/Classes/SpecializationData.lua"]:49: in function `parseNode'
[string "@Interface/AddOns/CraftSim/Data/Classes/SpecializationData.lua"]:75: in function `new'
[string "@Interface/AddOns/CraftSim/Libs/classic.lua"]:66: in function `SpecializationData'
[string "@Interface/AddOns/CraftSim/Data/Classes/RecipeData.lua"]:71: in function `new'
[string "@Interface/AddOns/CraftSim/Libs/classic.lua"]:66: in function `RecipeData'
[string "@Interface/AddOns/CraftSim/Main/CraftSim.lua"]:529: in function `TriggerModulesByRecipeType'
[string "@Interface/AddOns/CraftSim/Main/CraftSim.lua"]:189: in function `TriggerModulesErrorSafe'
[string "@Interface/AddOns/CraftSim/Main/CraftSim.lua"]:234: in function <Interface/AddOns/CraftSim/Main/CraftSim.lua:207>
[string "=[C]"]: ?
...
[string "@Interface/AddOns/Blizzard_Professions/Blizzard_ProfessionsFrame.lua"]:155: in function `SetProfessionInfo'
[string "@Interface/AddOns/Blizzard_Professions/Blizzard_ProfessionsFrame.lua"]:55: in function <...s/Blizzard_Professions/Blizzard_ProfessionsFrame.lua:53>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:143: in function <Interface/SharedXML/CallbackRegistry.lua:142>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:146: in function `TriggerEvent'
[string "@Interface/AddOns/Blizzard_ProfessionsTemplates/Blizzard_Professions.lua"]:1139: in function `set'
[string "@Interface/FrameXML/FilterDropDown.lua"]:103: in function `func'
[string "@Interface/SharedXML/UIDropDownMenu.lua"]:1007: in function `UIDropDownMenuButton_OnClick'
[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1: in function <[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1>

Locals: 
commented

Im sorry but I cannot reproduce it, when I am on my tailor and filter to show shadowlands or classic recipes it just works ^^

are you on CraftSim 8.0+?

You can try to delete the savedVariables wtf file (addon settings, also doable with curseforge manager) while logged out and then log in again

commented

Updated from 8.1 to 8.2 and removed settings, same issue still.

commented

I just tested it out of interest and I'm getting the same error when filtering to a previous expansion. Did a bit of testing and I think I understand what's causing it and how to reproduce it:

  1. Open any profession, does not have to be Tailoring specifically
  2. Set one or multiple dragonflight recipes as favorite
  3. Switch to a different expansion in the filter options
  4. Error pops up

Also interesting:

  • select a non-dragonflight recipe -> no error
  • select one of the favorited dragonflight recipes -> error pops up again
  • if a non-dragonflight recipes is at the top of your favorites list and you filter to a different expansion you don't get the error

Conclusion is that selecting a dragonflight recipe while not having the filter set to dragonflight is what causes the error, maybe because some things get unloaded when switching to older expansions?

21x CraftSim/Data/Classes/NodeData.lua:31: attempt to index local 'nodeInfo' (a nil value)
[string "@CraftSim/Data/Classes/NodeData.lua"]:31: in function `new'
[string "@CraftSim/Libs/classic.lua"]:66: in function `NodeData'
[string "@CraftSim/Data/Classes/SpecializationData.lua"]:49: in function `parseNode'
[string "@CraftSim/Data/Classes/SpecializationData.lua"]:75: in function `new'
[string "@CraftSim/Libs/classic.lua"]:66: in function `SpecializationData'
[string "@CraftSim/Data/Classes/RecipeData.lua"]:71: in function `new'
[string "@CraftSim/Libs/classic.lua"]:66: in function `RecipeData'
[string "@CraftSim/Main/CraftSim.lua"]:523: in function `TriggerModulesByRecipeType'
[string "@CraftSim/Main/CraftSim.lua"]:189: in function `TriggerModulesErrorSafe'
[string "@CraftSim/Main/CraftSim.lua"]:234: in function <CraftSim/Main/CraftSim.lua:207>
[string "=[C]"]: ?
[string "=[C]"]: in function `Init'
...
[string "@Blizzard_Professions/Blizzard_ProfessionsFrame.lua"]:155: in function `SetProfessionInfo'
[string "@Blizzard_Professions/Blizzard_ProfessionsFrame.lua"]:55: in function <...s/Blizzard_Professions/Blizzard_ProfessionsFrame.lua:53>
[string "=[C]"]: ?
[string "@SharedXML/CallbackRegistry.lua"]:143: in function <SharedXML/CallbackRegistry.lua:142>
[string "=[C]"]: ?
[string "@SharedXML/CallbackRegistry.lua"]:146: in function `TriggerEvent'
[string "@Blizzard_ProfessionsTemplates/Blizzard_Professions.lua"]:1139: in function `set'
[string "@FrameXML/FilterDropDown.lua"]:103: in function `func'
[string "@SharedXML/UIDropDownMenu.lua"]:1007: in function `UIDropDownMenuButton_OnClick'
[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1: in function <[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1>

Locals:
self = <table> {
 affectsRecipe = false
 recipeData = <table> {
 }
 nodeRules = <table> {
 }
 nodeID = 40008
 idMapping = <table> {
 }
 professionStats = <table> {
 }
 childNodes = <table> {
 }
}
recipeData = <table> {
 isEnchantingRecipe = false
 isCooking = false
 recipeID = 376556
 supportsCraftingStats = true
 categoryID = 1669
 learned = true
 isRecraft = false
 supportsCraftingspeed = true
 isSalvageRecipe = false
 recipeIcon = 4549303
 maxQuality = 3
 recipeName = "Azureweave Bolt"
 supportsInspiration = false
 isGear = false
 supportsMulticraft = false
 supportsQualities = true
 isSimulationModeData = false
 isOldWorldRecipe = false
 supportsResourcefulness = false
 professionData = <table> {
 }
 subtypeID = 5
 numSkillUps = 1
}
nodeRulesData = <table> {
 1 = <table> {
 }
}
parentNode = nil
configID = 0
nodeInfo = nil
(*temporary) = <function> defined =[C]:-1
(*temporary) = 0
(*temporary) = 40008
(*temporary) = "attempt to index local 'nodeInfo' (a nil value)"
commented

Just read #94 and it's the same issue, can probably be merged

commented

Same issue with Inscription when filtering on Classic. Maybe it's because I have some DF, WoD and Pandaria patterns in my Favourites list?
Edit: I just tested this by removing everything from my favourites list and then filtering on Classic. No error!

commented

I think it's something related to old professions not reporting information about specialization nodes without ranks.
I thought to solve this issue with this piece of code in NodeData.lua (row 31):

    local nodeInfo = C_Traits.GetNodeInfo(configID, self.nodeID)

    if (nodeInfo) then
        self.active = nodeInfo.activeRank > 0
        self.rank = nodeInfo.activeRank - 1
        self.maxRank = nodeInfo.maxRanks - 1
    else
        self.active = false
        self.rank = 0
        self.maxRank = 0
    end

As this can be related to having favorites from dragonflight and then switching to other expansions filters, perhaps my code is only a workaround to not have the lua error, but a more deep analysis on why it happens can be better.

I put this workround on the pull request for localization that's peding in queue (author is on vacation this week), if @derfloh205 think is better to understand the real reason can overwrite my commit without problems.