From c6e791f109413840593ae6fbd30881dd22d3fbe1 Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Fri, 4 Sep 2026 21:24:37 +0300 Subject: [PATCH 1/2] Fix "Simulating "Tukohama, War's Herald" prevents Fist of War from supporting skills granted by items" #10310 --- spec/System/TestItemMods_spec.lua | 18 ++++++++++++++++++ src/Modules/CalcSetup.lua | 13 ++++++++++++- src/Modules/Common.lua | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) 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..2f9e5a1c9d5 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 + local fromItemReplacements = {} -- Process support gems adding them to applicable support lists for index, group in ipairs(build.skillsTab.socketGroupList) do local slot = group.slot and build.itemsTab.slots[group.slot] @@ -1634,7 +1640,12 @@ function calcs.initEnv(build, mode, override, specEnv) 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 + if not fromItemReplacements[grantedEffect] then + local taggedGrantedEffect = copyTable(grantedEffect, true) + taggedGrantedEffect.fromItem = true + fromItemReplacements[grantedEffect] = taggedGrantedEffect + end + grantedEffect = fromItemReplacements[grantedEffect] end if grantedEffect then for _, targetList in ipairs(targetListList) do diff --git a/src/Modules/Common.lua b/src/Modules/Common.lua index b71053f5f24..6db5add9d31 100644 --- a/src/Modules/Common.lua +++ b/src/Modules/Common.lua @@ -543,7 +543,7 @@ function specCopy(env) end -- Wipe all keys from the table and return it, or return a new table if no table --- provided. This is useful to avoid alllocations in hot paths if a table can be reused. Using LuaJIT's `table.clear()` is another alternative to this, but this performs similarly on small tables, or tables which are often already empty. +-- provided. This is useful to avoid allocations in hot paths if a table can be reused. Using LuaJIT's `table.clear()` is another alternative to this, but this performs similarly on small tables, or tables which are often already empty. ---@param tbl table? ---@return table tbl function wipeTable(tbl) From af28b7227e39a213648431e82d5f5596d728e334 Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Fri, 4 Sep 2026 21:28:51 +0300 Subject: [PATCH 2/2] Fix spacing --- src/Modules/CalcSetup.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 2f9e5a1c9d5..e1fc9da72bc 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -1601,9 +1601,9 @@ function calcs.initEnv(build, mode, override, specEnv) 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. + -- 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 local fromItemReplacements = {} -- Process support gems adding them to applicable support lists