Skip to content

Commit 033e66a

Browse files
Fix runes not being correctly updated when pasting items with less than full sockets. (#159)
* Fix issue runes not being correctly updated. * Fix bug with changing rune count.
1 parent c5e55b7 commit 033e66a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Classes/Item.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,9 @@ end
10971097
function ItemClass:UpdateRunes()
10981098
wipeTable(self.runeModLines)
10991099
local statOrder = {}
1100-
for _, name in ipairs(self.runes) do
1101-
if name ~= "None" then
1100+
for i = 1, self.itemSocketCount do
1101+
local name = self.runes[i]
1102+
if name and name ~= "None" then
11021103
local mod = self.base.weapon and data.itemMods.Runes[name].weapon or self.base.armour and data.itemMods.Runes[name].armour or { }
11031104
for i, line in ipairs(mod) do
11041105
local order = mod.statOrder[i]

src/Classes/ItemsTab.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,10 +1565,14 @@ function ItemsTabClass:UpdateRuneControls()
15651565
elseif item.base.weapon then
15661566
self.controls["displayItemRune"..i].list = runeWeaponModLines
15671567
end
1568-
for j, modLine in ipairs(self.controls["displayItemRune"..i].list) do
1569-
if item.runes[i] == modLine.name then
1570-
self.controls["displayItemRune"..i].selIndex = j
1568+
if item.runes[i] then
1569+
for j, modLine in ipairs(self.controls["displayItemRune"..i].list) do
1570+
if item.runes[i] == modLine.name then
1571+
self.controls["displayItemRune"..i].selIndex = j
1572+
end
15711573
end
1574+
else
1575+
self.controls["displayItemRune"..i].selIndex = 1
15721576
end
15731577
end
15741578
end

0 commit comments

Comments
 (0)