Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,35 @@ describe("TestSkills", function()
assert.is_nil(build.calcsTab.mainOutput[test[3]])
end
end)

it("ignores invalid extra supports while allowing support name collisions", function()
build.skillsTab:PasteSocketGroup("Slot: Gloves\nFireball 20/0 1")
runCallback("OnFrame")
build.configTab.input.customMods = "Skills socketed in your gloves are supported by level 20 Arc"
build.configTab:BuildModList()
build.modFlag = true
build.buildFlag = true
assert.has_no.errors(function()
main:OnFrame()
end)
assert.are.equals(0, #build.calcsTab.mainEnv.player.mainSkill.supportList)

newBuild()
build.skillsTab:PasteSocketGroup("Slot: Gloves\nFireball 20/0 1")
build.configTab.input.customMods = "Skills socketed in your gloves are supported by level 20 Arcane Surge"
build.configTab:BuildModList()
main:OnFrame()
local arcaneSurge = build.calcsTab.mainEnv.player.mainSkill.supportList[1]
assert.are.equals("SupportArcaneSurge", arcaneSurge.grantedEffect.id)
assert.are.equals(20, arcaneSurge.level)

newBuild()
build.skillsTab:PasteSocketGroup("Slot: Gloves\nRain of Arrows 20/0 1")
build.configTab.input.customMods = "Skills socketed in your gloves are supported by level 20 Barrage"
build.configTab:BuildModList()
main:OnFrame()
local barrage = build.calcsTab.mainEnv.player.mainSkill.supportList[1]
assert.are.equals("SupportBarrage", barrage.grantedEffect.id)
assert.are.equals(20, barrage.level)
end)
end)
5 changes: 2 additions & 3 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1525,14 +1525,13 @@ function calcs.initEnv(build, mode, override, specEnv)

local function addExtraSupports(value, grantedEffect, level)
local grantedEffect = grantedEffect or env.data.skills[value.skillId]
if value and grantedEffect then -- Only item ExtraSupport gems should be flagged as fromItem. Imbued gems do not pass this check
grantedEffect.fromItem = true
end
-- Some skill gems share the same name as support gems, e.g. Barrage.
-- Since a support gem is expected here, if the first lookup returns a skill, then
-- prepending "Support" to the skillId will find the support version of the gem.
if value and grantedEffect and not grantedEffect.support then
grantedEffect = env.data.skills["Support"..value.skillId]
end
if value and grantedEffect then -- Only item ExtraSupport gems should be flagged as fromItem. Imbued gems do not pass this check
grantedEffect.fromItem = true
end
if grantedEffect then
Expand Down
Loading