Skip to content

Commit 2a0a10c

Browse files
committed
stop passing all of self and instead only the parts we need
1 parent 49d81a2 commit 2a0a10c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,14 +1581,14 @@ function ItemsTabClass:DeleteItem(item, deferUndoState)
15811581
end
15821582
end
15831583

1584-
local function copyAnointsAndEldritchImplicits(self, newItem)
1584+
local function copyAnointsAndEldritchImplicits(newItem, activeItemSet, items)
15851585
local newItemType = newItem.base.type
1586-
if self.activeItemSet[newItemType] then
1587-
local currentItem = self.activeItemSet[newItemType].selItemId and self.items[self.activeItemSet[newItemType].selItemId]
1586+
if activeItemSet[newItemType] then
1587+
local currentItem = activeItemSet[newItemType].selItemId and items[activeItemSet[newItemType].selItemId]
15881588
-- if you don't have an equipped item that matches the type of the newItem, no need to do anything
15891589
if currentItem then
15901590
-- if the new item is anointable and does not have an anoint and your current respective item does, apply that anoint to the new item
1591-
if isAnointable(newItem) and #newItem.enchantModLines == 0 and self.activeItemSet[newItemType].selItemId > 0 then
1591+
if isAnointable(newItem) and #newItem.enchantModLines == 0 and activeItemSet[newItemType].selItemId > 0 then
15921592
local currentAnoint = currentItem.enchantModLines
15931593
if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp
15941594
newItem.enchantModLines = currentAnoint
@@ -1618,7 +1618,7 @@ end
16181618
function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise)
16191619
local newItem = new("Item", itemRaw)
16201620
if newItem.base then
1621-
copyAnointsAndEldritchImplicits(self, newItem)
1621+
copyAnointsAndEldritchImplicits(newItem, self.activeItemSet, self.items)
16221622
if normalise then
16231623
newItem:NormaliseQuality()
16241624
newItem:BuildModList()

0 commit comments

Comments
 (0)