@@ -838,8 +838,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
838838 end
839839 end
840840 -- Use rolling Delta/Range in case one range is 1-3 and another is 1-100 so we get the finest precision possible
841- local bestPrecisionDelta = 0
842- local bestPrecisionRange = 0
841+ local bestPrecisionDelta = - 1
842+ local bestPrecisionRange = - 1
843843 for value , range in line :gmatch (" (%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)" ) do
844844 -- Find advanced copy paste format: 45(40-50)
845845 local min , max = range :match (" (%-?%d+%.?%d*)%-(%-?%d+%.?%d*)" )
@@ -857,8 +857,12 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
857857 self .pendingAffixList = {}
858858 else
859859 -- Use rolling Delta/Range in case one range is 1-3 and another is 1-100 so we get the finest precision possible
860- local bestPrecisionDelta = 0
861- local bestPrecisionRange = 0
860+ local bestPrecisionDelta = - 1
861+ local bestPrecisionRange = - 1
862+
863+ -- Replace non-number ranges as unsupported
864+ line = line :gsub (" (%a+)%([%a%s]+%-[%a%s]+%)" , " %1" )
865+
862866 for value , range in line :gmatch (" (%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)" ) do
863867 local min , max = range :match (" (%-?%d+%.?%d*)%-(%-?%d+%.?%d*)" )
864868 local delta = tonumber (max ) - min
@@ -869,7 +873,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
869873 if bestPrecisionRange > 1 or bestPrecisionRange < 0 then
870874 line = line :gsub (value .. " %(" .. range :gsub (" %-" , " %%-" ) .. " %)" , value )
871875 else
872- line = line :gsub (value .. " %(" .. range :gsub (" %-" , " %%-" ) .. " %)" , " (" .. range .. " )" )
876+ line = line :gsub (value .. " %(" .. range :gsub (" %-" , " %%-" ) .. " %)" , ( tonumber ( value ) < 0 and " + " or " " ) .. " (" .. range .. " )" )
873877 end
874878 end
875879 if bestPrecisionRange <= 1 and bestPrecisionRange >= 0 then
0 commit comments