diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index a345a9f14e..9b4e5c456d 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -175,7 +175,16 @@ function TradeQueryGeneratorClass.WeightedRatioOutputs(baseOutput, newOutput, st baseModSum = baseModSum + (baseOutput[mod] or 0) newModSum = newModSum + (newOutput[mod] or 0) end - return newModSum / ((baseModSum ~= 0) and baseModSum or 1) + + if baseModSum == math.huge then + return 0 + else + if newModSum == math.huge then + return data.misc.maxStatIncrease + else + return math.min(newModSum / ((baseModSum ~= 0) and baseModSum or 1), data.misc.maxStatIncrease) + end + end end for _, statTable in ipairs(statWeights) do if statTable.stat == "FullDPS" and not GlobalCache.useFullDPS then diff --git a/src/Modules/Data.lua b/src/Modules/Data.lua index 6dde8b8c0d..e12368ff43 100644 --- a/src/Modules/Data.lua +++ b/src/Modules/Data.lua @@ -496,6 +496,8 @@ data.misc = { -- magic numbers ehpCalcMaxDamage = 100000000, -- max iterations can be increased for more accuracy this should be perfectly accurate unless it runs out of iterations and so high eHP values will be underestimated. ehpCalcMaxIterationsToCalc = 50, + -- maximum increase for stat weights, only used in trader for now. + maxStatIncrease = 2, -- 100% increased -- PvP scaling used for hogm PvpElemental1 = 0.55, PvpElemental2 = 150,