From e42026eef0e5335663f2cfa3ebebfb241ababdf4 Mon Sep 17 00:00:00 2001 From: Paliak <91493239+Paliak@users.noreply.github.com> Date: Fri, 20 Mar 2026 19:34:23 +0100 Subject: [PATCH 1/2] FIX: CwC crash when using skills form items and multiple link groups Due to the triggerTime being on the support part that supports the triggering channeled skill the CwC handler relies on the triggerTime property stored in the skillData table of the trigger source skill. This is problematic since the slotMatch logic for triggered skills coming from items checks all socket groups in a given item regardless of whether they are crosslinked with cast while channeling or not. This pr reworks the trigger source finding logic for cast while channeling to both speed it up and fix this issue. Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com> --- src/Modules/CalcTriggers.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Modules/CalcTriggers.lua b/src/Modules/CalcTriggers.lua index c0940ca031..1b09e08262 100644 --- a/src/Modules/CalcTriggers.lua +++ b/src/Modules/CalcTriggers.lua @@ -219,18 +219,17 @@ end local function CWCHandler(env) if not env.player.mainSkill.skillFlags.minion and not env.player.mainSkill.skillFlags.disable then local triggeredSkills = {} - local trigRate = 0 local source = nil local triggerName = "Cast While Channeling" local output = env.player.output local breakdown = env.player.breakdown for _, skill in ipairs(env.player.activeSkillList) do - local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot - local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup - if env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill) and skill ~= env.player.mainSkill and (match1 or match2) and not isTriggered(skill) then - source, trigRate = findTriggerSkill(env, skill, source, trigRate) + local canSupport = env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill) + local slotMatch = slotMatch(env, skill) + if not source and skill.skillData.triggerTime and canSupport and skill ~= env.player.mainSkill and slotMatch and not isTriggered(skill) then + source = skill end - if skill.skillData.triggeredWhileChannelling and (match1 or match2) then + if skill.skillData.triggeredWhileChannelling and slotMatch then t_insert(triggeredSkills, packageSkillDataForSimulation(skill, env)) end end From 63c317fbc600a6fb0a0a9647bbd9c5ef2bd1039c Mon Sep 17 00:00:00 2001 From: Paliak <91493239+Paliak@users.noreply.github.com> Date: Sun, 22 Mar 2026 11:34:31 +0100 Subject: [PATCH 2/2] FIX: only calc canSupport if not source Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com> --- src/Modules/CalcTriggers.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Modules/CalcTriggers.lua b/src/Modules/CalcTriggers.lua index 1b09e08262..acb7540db1 100644 --- a/src/Modules/CalcTriggers.lua +++ b/src/Modules/CalcTriggers.lua @@ -224,10 +224,12 @@ local function CWCHandler(env) local output = env.player.output local breakdown = env.player.breakdown for _, skill in ipairs(env.player.activeSkillList) do - local canSupport = env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill) local slotMatch = slotMatch(env, skill) - if not source and skill.skillData.triggerTime and canSupport and skill ~= env.player.mainSkill and slotMatch and not isTriggered(skill) then - source = skill + if not source then + local canSupport = env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill) + if skill.skillData.triggerTime and canSupport and skill ~= env.player.mainSkill and slotMatch and not isTriggered(skill) then + source = skill + end end if skill.skillData.triggeredWhileChannelling and slotMatch then t_insert(triggeredSkills, packageSkillDataForSimulation(skill, env))