From 602fc6ab0eb8398383e0a774b94754e934a210f0 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Fri, 29 May 2026 11:43:04 -0500 Subject: [PATCH] Fix rangeless mods not getting pasted properly --- src/Classes/Item.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index f0b2ecbed..846c19ceb 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -461,7 +461,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) if #self.pendingAffixList == 0 and #backupAffixList > 0 then self.pendingAffixList = backupAffixList end - if #self.pendingAffixList == 0 and #backupAffixList == 0 then + if #self.pendingAffixList == 0 then -- Could be a veiled, temple, or other custom mod, so just keep it around linePrefix = "{custom}" end @@ -853,12 +853,17 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) end if self.pendingAffixList and #self.pendingAffixList > 0 then if #self.pendingAffixList > 1 then - -- Probably a conqueror mod since the mod name is the same for all of them + -- Probably a conqueror or Essence mod since the mod name is the same for all of them -- Try to match the line against one of the mods there local valueStrippedLine = line:gsub("%-?%d+%.?%d*%(", "("):gsub("%-?%d+%.?%d*", "#") for _, pendingAffix in ipairs(self.pendingAffixList) do local modData = self.affixes[pendingAffix.modId] for _, modDataLine in ipairs(modData) do + -- Prefer the exact match + if line == modDataLine then + self.pendingAffixList = { pendingAffix } + break + end if valueStrippedLine == modDataLine:gsub("%-?%d+%.?%d*", "#") then self.pendingAffixList = { pendingAffix } break @@ -881,7 +886,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) end t_insert(self.pendingAffixList[1].table, { modId = self.pendingAffixList[1].modId, - range = tonumber(bestPrecisionRange), + range = bestPrecisionRange >= 0 and bestPrecisionRange <= 1 and bestPrecisionRange or 0.5, }) self.pendingAffixList = {} else @@ -906,7 +911,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) end end if bestPrecisionRange <= 1 and bestPrecisionRange >= 0 then - modLine.range = tonumber(bestPrecisionRange) + modLine.range = bestPrecisionRange end end local rangedLine = itemLib.applyRange(line, 1, catalystScalar, modLine.corruptedRange)