Skip to content

Commit c72f554

Browse files
committed
Don't scale lines that don't scale
1 parent d7c2f75 commit c72f554

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,9 @@ function ItemsTabClass:CorruptDisplayItem(modType)
27892789
selectedVariant = true
27902790
end
27912791
end
2792-
if #variantIds > 0 and selectedVariant or #variantIds == 0 then
2792+
-- test if a mod is scalable at all. this will let through mods that scale, but don't actually change within the corrupt range
2793+
local testScaledLine = itemLib.applyRange(mod.line, mod.range or main.defaultItemAffixQuality, mod.valueScalar or 1, 2)
2794+
if not (testScaledLine == mod.line) and #variantIds > 0 and selectedVariant or #variantIds == 0 then
27932795
local label = ""
27942796
controls["rollRangeValue" .. i] = new("LabelControl"):LabelControl({ "TOPLEFT", nil, "TOPLEFT" },
27952797
{ 10, 10 + offset, 200, 16 }, "^71.00")

src/Modules/ItemTools.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ function itemLib.applyRange(line, range, valueScalar, baseValueScalar)
9999
--- Takes a completely strippedLine where all values and ranges are replaced with a # + signs are kept for consistency upon re-substitution.
100100
--- This will then substitute back in the values until a line in scalabilityData is found this start with substituting everything and until none.
101101
--- This means if there is a more generic mod that might be scalable on both parameters but their is a narrower one that isn't it won't be scaled.
102-
---@param line the modLine stripped of all values and ranges replaced by #
103-
---@param values all values present in the modLine
104-
---@return scalableLine line with only scalableValues replaced with #
105-
---@return scalableValues values which can be scaled and added into scalableLine in place of a #
102+
---@param line string the modLine stripped of all values and ranges replaced by #
103+
---@param values any values present in the modLine
104+
---@return any scalableLine line with only scalableValues replaced with #
105+
---@return any scalableValues values which can be scaled and added into scalableLine in place of a #
106106
local function findScalableLine(line, values)
107107
local function replaceNthInstance(input, pattern, replacement, n)
108108
local count = 0

0 commit comments

Comments
 (0)