|
| 1 | +diff a/src/Classes/Item.lua b/src/Classes/Item.lua (rejected hunks) |
| 2 | +@@ -838,8 +838,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
| 3 | + end |
| 4 | + end |
| 5 | + -- Use rolling Delta/Range in case one range is 1-3 and another is 1-100 so we get the finest precision possible |
| 6 | +- local bestPrecisionDelta = 0 |
| 7 | +- local bestPrecisionRange = 0 |
| 8 | ++ local bestPrecisionDelta = -1 |
| 9 | ++ local bestPrecisionRange = -1 |
| 10 | + for value, range in line:gmatch("(%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)") do |
| 11 | + -- Find advanced copy paste format: 45(40-50) |
| 12 | + local min, max = range:match("(%-?%d+%.?%d*)%-(%-?%d+%.?%d*)") |
| 13 | +@@ -857,8 +857,12 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
| 14 | + self.pendingAffixList = {} |
| 15 | + else |
| 16 | + -- Use rolling Delta/Range in case one range is 1-3 and another is 1-100 so we get the finest precision possible |
| 17 | +- local bestPrecisionDelta = 0 |
| 18 | +- local bestPrecisionRange = 0 |
| 19 | ++ local bestPrecisionDelta = -1 |
| 20 | ++ local bestPrecisionRange = -1 |
| 21 | ++ |
| 22 | ++ -- Replace non-number ranges as unsupported |
| 23 | ++ line = line:gsub("(%a+)%([%a%s]+%-[%a%s]+%)", "%1") |
| 24 | ++ |
| 25 | + for value, range in line:gmatch("(%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)") do |
| 26 | + local min, max = range:match("(%-?%d+%.?%d*)%-(%-?%d+%.?%d*)") |
| 27 | + local delta = tonumber(max) - min |
| 28 | +@@ -869,7 +873,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
| 29 | + if bestPrecisionRange > 1 or bestPrecisionRange < 0 then |
| 30 | + line = line:gsub(value .. "%(" .. range:gsub("%-", "%%-") .. "%)", value) |
| 31 | + else |
| 32 | +- line = line:gsub(value .. "%(" .. range:gsub("%-", "%%-") .. "%)", "(" .. range .. ")") |
| 33 | ++ line = line:gsub(value .. "%(" .. range:gsub("%-", "%%-") .. "%)", (tonumber(value) < 0 and "+" or "") .. "(" .. range .. ")") |
| 34 | + end |
| 35 | + end |
| 36 | + if bestPrecisionRange <= 1 and bestPrecisionRange >= 0 then |
0 commit comments