Skip to content

Commit c782fee

Browse files
author
LocalIdentity
committed
Fix desecrated specific mods not showing up for maces and other weapons
Some of the desecrated only mods weren't correctly looking through the spawn tags Also now doesn't use the existance of an essence mod for the desecrated mod pool to show up
1 parent 7140b0a commit c782fee

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,6 +2839,13 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
28392839
end
28402840
end)
28412841
elseif sourceId == "DESECRATED" then
2842+
local function isDesecratedMod(mod)
2843+
for _, tag in ipairs(mod.modTags or { }) do
2844+
if tag == "ulaman_mod" or tag == "amanamu_mod" or tag == "kurgal_mod" then
2845+
return true
2846+
end
2847+
end
2848+
end
28422849
for _, mod in pairs(self.displayItem.affixes) do -- Normal mods for the item can be desecrated as well.
28432850
if (mod.type == "Prefix" or mod.type == "Suffix") and self.displayItem:GetModSpawnWeight(mod) > 0 then
28442851
t_insert(modList, {
@@ -2848,18 +2855,14 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
28482855
})
28492856
end
28502857
end
2851-
for modId, mod in pairs(self.build.data.itemMods.Desecrated) do
2852-
for _, weightKey in pairs(mod.weightKey) do
2853-
local tag_name = weightKey:lower()
2854-
local item_type = self.displayItem.type:lower():gsub(" ", "_")
2855-
if tag_name == item_type then
2856-
t_insert(modList, {
2857-
label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)",
2858-
mod = mod,
2859-
type = "desecrated",
2860-
desecratedSpecific = true,
2861-
})
2862-
end
2858+
for _, mod in pairs(self.build.data.itemMods.Desecrated) do
2859+
if isDesecratedMod(mod) and self.displayItem:GetModSpawnWeight(mod) > 0 then
2860+
t_insert(modList, {
2861+
label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)",
2862+
mod = mod,
2863+
type = "desecrated",
2864+
desecratedSpecific = true,
2865+
})
28632866
end
28642867
end
28652868
table.sort(modList, function(a, b)
@@ -2893,10 +2896,13 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
28932896
t_insert(sourceList, { label = "Suffix", sourceId = "SUFFIX" })
28942897
end
28952898
buildMods("DESECRATED")
2899+
local hasDesecratedMods = #modList > 0
28962900
buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods,
28972901
-- but it makes it so we don't have to maintain a list of applicable essence-able base types
28982902
if #modList > 0 then
28992903
t_insert(sourceList, { label = "Essence", sourceId = "ESSENCE" })
2904+
end
2905+
if hasDesecratedMods then
29002906
t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" })
29012907
end
29022908
t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" })

0 commit comments

Comments
 (0)