Skip to content

Commit 0bd5b49

Browse files
committed
Fix 'maxValue' not working for strength
`maxDiff` was initialized at `0`, which led to problems when the difference in attribute ratio was nominally negative. There is secondary issue that needs to be fixed related to this, but at least this ensures that maximum value always applies as a limit. The other issue is that target ratios should be recalculated if a maximum value is reached because it changes the relative weights of the remaining attributes. Will be done in separate commit
1 parent 60391d1 commit 0bd5b49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ function PassiveSpecClass:GetAutoAttribute(cachedPlayerAttr, cachedPathAttrResul
22102210
playerAttr.int.ratio = playerAttr.int.total / playerAttr.sumTotal
22112211
playerAttr.str.ratio = playerAttr.str.total / playerAttr.sumTotal
22122212

2213-
local maxDiff = 0
2213+
local maxDiff = nil
22142214
local neededAttr = nil
22152215

22162216
-- Update weights based on attribute requirements if necessary
@@ -2222,7 +2222,7 @@ function PassiveSpecClass:GetAutoAttribute(cachedPlayerAttr, cachedPathAttrResul
22222222
-- Check if the max value is set and if it's already been exceeded.
22232223
if autoAttributeConfig[attr].max == nil or (not autoAttributeConfig[attr].useMaxVal) or playerAttr[attr].total < autoAttributeConfig[attr].max then
22242224
local diff = autoAttributeConfig[attr].ratio - playerAttr[attr].ratio
2225-
if diff > maxDiff then
2225+
if (maxDiff == nil) or (diff > maxDiff) then
22262226
maxDiff = diff
22272227
neededAttr = attr
22282228
end

0 commit comments

Comments
 (0)