CraftSim

CraftSim

2M Downloads

Some recipes throw an error in StatweightCalculation.lua:93

Znuff opened this issue ยท 2 comments

commented

Trace:

1x CraftSim/StatweightCalculation.lua:93: bad argument #1 to 'pairs' (table expected, got nil)
[string "=[C]"]: in function `pairs'
[string "@CraftSim/StatweightCalculation.lua"]:93: in function `GetExpectedQualityBySkill'
[string "@CraftSim/Frames.lua"]:1345: in function `UpdateSimModeStatDetails'
[string "@CraftSim/SimMode.lua"]:95: in function `InitSimModeData'
[string "@CraftSim/CraftSim.lua"]:343: in function `TriggerModulesByRecipeType'
[string "@CraftSim/CraftSim.lua"]:100: in function <CraftSim/CraftSim.lua:99>

Recipe: https://www.wowhead.com/spell=376564/fiddle-with-khazgorite-fabric-cutters

Checking for thresholds before should fix it:

    if thresholds then
        for _, threshold in pairs(thresholds) do
            if skill > threshold then
                expectedQuality = expectedQuality + 1
            end
        end
    end
commented

Also not able to reproduce in 1.7.7

commented

As I was not able to reproduce it in the newest version and had no other people report that I am closing this for now
If this occurs again feel free to open another issue!
Have a nice day :)