diff --git a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua index 3aa079e67b9..4034535a947 100644 --- a/spec/System/TestItemMods_spec.lua +++ b/spec/System/TestItemMods_spec.lua @@ -1103,4 +1103,22 @@ describe("TetsItemMods", function() assert.is_not_nil(sentinel) assert.are.equals(1, countSupport(sentinel, "SupportMinionDamage")) end) + -- #10310 + it("an item's own ExtraSupport for a support gem does not disable that support elsewhere", function() + addItem("Supporting Gloves\nSpiked Gloves\nGrants Level 20 Sunder") + build.skillsTab:PasteSocketGroup("Slot: Gloves\nFist of War 20/0 1\n") + runCallback("OnFrame") + + local sunder = findActiveSkill("Sunder") + assert.is_not_nil(sunder) + assert.is_true(hasSupport(sunder, "SupportFistofWar")) + + addItem("Breaking Body Armour\nSimple Robe\nSkills from Equipped Body Armour are Supported by Level 20 Fist of War") + build.skillsTab:PasteSocketGroup("Slot: Body Armour\nHeavy Strike 20/0 1\n") + runCallback("OnFrame") + + sunder = findActiveSkill("Sunder") + assert.is_not_nil(sunder) + assert.is_true(hasSupport(sunder, "SupportFistofWar")) + end) end) diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 70301168360..e1fc9da72bc 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -1600,6 +1600,12 @@ function calcs.initEnv(build, mode, override, specEnv) local supportLists = { } local groupCfgList = { } local processedSockets = {} + -- granted effects normally refer to the global tables in data.skills, + -- which means that modifying them will do so permanently until the + -- client is restarted. this avoids that by mapping from the original + -- table to a modified table. + ---@type table