Skip to content

Commit f40d550

Browse files
author
LocalIdentity
committed
Fix some bonded Rune affects applying without the needed Ascendancy
The logic for combining Rune stats on gear wasn't check to see if a mod was bonded before merging the stat We now use a separate key so they no longer merge with each other but will merge correctly with other rune mods of the same type
1 parent 29cd547 commit f40d550

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

spec/System/TestItemParse_spec.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,22 @@ describe("TestItemParse", function()
460460
end
461461
end)
462462

463+
it("keeps bonded rune stats separate from normal rune stats", function()
464+
local item = new("Item", [[
465+
Rarity: Rare
466+
Test Body
467+
Rusted Cuirass
468+
]])
469+
item.itemSocketCount = 1
470+
item.runes = { "Lesser Body Rune" }
471+
item:UpdateRunes()
472+
473+
assert.are.equals(3, #item.runeModLines)
474+
assert.are.equals("+30 to maximum Life", item.runeModLines[1].line)
475+
assert.are.equals("Bonded: +20 to maximum Life", item.runeModLines[2].line)
476+
assert.are.equals("Bonded: +20 to maximum Mana", item.runeModLines[3].line)
477+
end)
478+
463479
it("multi-line rune mod", function()
464480
-- Thruldana is Bow-only as well
465481
local item = new("Item", [[

src/Classes/Item.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,10 +1519,11 @@ function ItemClass:UpdateRunes()
15191519
for _, mod in ipairs(gatheredMods) do
15201520
for i, modLine in ipairs(mod) do
15211521
local order = mod.statOrder[i]
1522-
if statOrder[order] then
1522+
local orderKey = modLine:match("^Bonded:") and "Bonded:"..order or order
1523+
if statOrder[orderKey] then
15231524
-- Combine stats
15241525
local start = 1
1525-
statOrder[order].line = statOrder[order].line:gsub("(%d%.?%d*)", function(num)
1526+
statOrder[orderKey].line = statOrder[orderKey].line:gsub("(%d%.?%d*)", function(num)
15261527
local s, e, other = mod[i]:find("(%d%.?%d*)", start)
15271528
start = e + 1
15281529
return tonumber(num) + tonumber(other)
@@ -1535,7 +1536,7 @@ function ItemClass:UpdateRunes()
15351536
break
15361537
end
15371538
end
1538-
statOrder[order] = modLine
1539+
statOrder[orderKey] = modLine
15391540
end
15401541
end
15411542
end

0 commit comments

Comments
 (0)