Add QoL when comparing Anointed Amulets (#9276)

* auto apply anoint to display ammy if it doesn't already have one

* nil check

* typo
This commit is contained in:
Peechey
2025-11-17 21:40:13 -06:00
committed by GitHub
parent 3915c38036
commit 15876b736c

View File

@@ -1542,6 +1542,14 @@ end
function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise)
local newItem = new("Item", itemRaw)
if newItem.base then
-- if the new item is an amulet and does not have an anoint and your current amulet does, apply that anoint to the new item
if newItem.base.type == "Amulet" and #newItem.enchantModLines == 0 and self.activeItemSet["Amulet"].selItemId > 0 then
local currentAnoint = self.items[self.activeItemSet["Amulet"].selItemId].enchantModLines
if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp
newItem.enchantModLines = currentAnoint
newItem:BuildAndParseRaw()
end
end
if normalise then
newItem:NormaliseQuality()
newItem:BuildModList()