Skip to content

Commit e0198da

Browse files
authored
FIX: allow selectively matching variants for GemProperty mods (#7101)
1 parent 808c62a commit e0198da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Modules/CalcSetup.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ local function applyGemMods(effect, modList)
274274
local match = true
275275
if value.keywordList then
276276
for _, keyword in ipairs(value.keywordList) do
277-
if not calcLib.gemIsType(effect.gemData, keyword) then
277+
if not calcLib.gemIsType(effect.gemData, keyword, true) then
278278
match = false
279279
break
280280
end
281281
end
282-
elseif not calcLib.gemIsType(effect.gemData, value.keyword) then
282+
elseif not calcLib.gemIsType(effect.gemData, value.keyword, true) then
283283
match = false
284284
end
285285
if match then

src/Modules/CalcTools.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill)
101101
end
102102

103103
-- Check if given gem is of the given type ("all", "strength", "melee", etc)
104-
function calcLib.gemIsType(gem, type)
104+
function calcLib.gemIsType(gem, type, allowVariants)
105105
return (type == "all" or
106106
(type == "elemental" and (gem.tags.fire or gem.tags.cold or gem.tags.lightning)) or
107107
(type == "aoe" and gem.tags.area) or
@@ -110,6 +110,7 @@ function calcLib.gemIsType(gem, type)
110110
(type == "non-vaal" and not gem.tags.vaal) or
111111
(type == gem.name:lower()) or
112112
(type == gem.name:lower():gsub("^vaal ", "")) or
113+
(allowVariants and gem.name:lower():match("^" .. type:lower())) or
113114
((type ~= "active skill" and type ~= "grants_active_skill" and type ~= "skill") and gem.tags[type]))
114115
end
115116

0 commit comments

Comments
 (0)